Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine which methods are not implemented when XCode has warnings

Sometimes I have a interface that implements several protocols and I'll get a warning from XCode that my implementation is incomplete.

Is there an easy way to determine which methods are "required" but but implemented (without having to put in dummy implementations of all the non-optional methods from the protocol header files)?

For example, I have a warning on this interface but I don't want to have to dig through all the protocols.. obviously XCode knows that some are missing, why can't it just tell which they are!

@interface KTThumbsViewController : UIViewController <KTThumbsViewDataSource, UIImagePickerControllerDelegate, UINavigationControllerDelegate, UIAlertViewDelegate>

XCode 4

enter image description here

like image 854
Michael Peterson Avatar asked Dec 17 '11 01:12

Michael Peterson


3 Answers

Didn't find the answer here, unfortunately. But a bit more digging turned up an answer, in the Issue navigator in the Navigator View.

Open the Navigator view via the View buttons at upper-right:

View Navigator toggle button

Then open the Issue navigator via the triangle/exclamation mark button at upper-left:

enter image description here

If you expand your "Incomplete implementation" Semantic Issue with the little triangle at left, you can see the details of XCode's complaint.

like image 55
ericsoco Avatar answered Nov 01 '22 02:11

ericsoco


Press alt and click on the protocol, xcode will show you where it is defined so you can take a look at the header file. Alternatively in the "issues" tab it will show you which methods you did not implement yet.

like image 6
Antwan van Houdt Avatar answered Nov 01 '22 03:11

Antwan van Houdt


As a followup to this

Sometimes "Incomplete Implementation" really means "Mismatch between the function prototype and the implemented function".

For example, if in your .h file you had this:

- (NSTimeInterval) SayDigit: (int) score;

But in your .m file you had this:

- (NSTimeInterval) SayDigit: (int) digit: (NSTimeInterval) time

You would get the "Incomplete Implementation" warning.

like image 1
BrianS Avatar answered Nov 01 '22 04:11

BrianS