delegate method aren't "not used"!

I really like this functionality of Appcode, show me when a method is not used is a great info to discover dead code or code smell...but when you implment some protocol like UITableViewDelegate, you must add some method and those methods are never called directly in your code.

I'm talking about methods like

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

Mark those methods as "not used" is not 100% correct...

there is any solution?


Permanently deleted user

Hello Ignazio.

This can be solved by explicitly declaring that your class implements a corresponding protocol.

@interface MySomething : NSObject<UITableViewDataSource>

BTW any inspection can be disabled at file or statement level. Just hit Alt+Enter, select the inspection, open its properties with the right arrow key and then select one of the supressing options.

Screen Shot 2014-07-14 at 19.54.11.png

Please sign in to leave a comment.