How to fix "Protocol Not Implemented" How to fix "Protocol Not Implemented" xcode xcode

How to fix "Protocol Not Implemented"


Show the issues navigator and expand one of the "method in protocol not implemented" issues. The first detail item will show you where the method is defined in the headers (and, thus, which @protocol it's in). Even better, though, the second detail will show you the name of the protocol.

Switch to the Issues navigator. Ignore the Incomplete implementation message, and look at the Method in protocol not implemented message. You can expand this message to get more information that the compiler provided. The first detail is what you're looking for:

Method declared here

You can see here that I've forgotten to include a method for tableView:numberOfRowsInSection:. I can copy this declaration and paste it into my own code to start writing the method.

Note that there are three issues in my issue navigator. The third is another missing method, which can also be expanded and copied in the same way.


There are two things I can think of which you can look for. First, look in your .h file and see if you have any method prototypes that you may have forgotten to implement, or else implemented and then changed the implementation such that it no longer matched the prototype's method signature.

Second, if the compiler isn't telling you which methods are missing, look at the documentation of UITableViewDelegate, UITableViewDataSource, etc. In the Tasks section, where it lists the various public class and instance methods, it will say "required method" next to any that need to be there. For example, if you class conforms to the UITableViewDataSource delegate protocol, -tableView:cellForRowAtIndexPath: and -tableView:numberOfRowsInSection: are required.


Check your projectname-Prefix.pch file. I got carried away there and imported something I shouldn't have, and that made it look like the one protocol I was implementing in that class was not implemented, when in fact it was. Just go ahead and make sure you aren't including any protocols there.

In my case it was because the file I shouldn't have imported was another protocol file, that was not directly related to the class where I was getting the warning.

Also when you clean out your *-Prefix.pch file, make sure you close and re-open Xcode. I had to do that to get it to take.

Hope this helps!!