On Jun 11, 2014, at 2:38 PM, Scott Ribe < email@hidden> wrote: On Jun 11, 2014, at 11:44 AM, Bill Cheeseman <email@hidden> wrote:
1. I eyeballed the code intensively. This revealed no errors, and I see the required datasource methods right where they're supposed to be.
A couple of times, I've had errors that could only be explained by the non-existence of a method which was clearly implemented. Deleting the method name and re-typing it worked-aas though there were some invisible character in the name.
Good suggestion. I have encountered hidden control characters in code before, usually when copied from some non-programming file like an ebook and pasted into Xcode. So I pasted the method names into TextWrangler and applied its Zap Gremlins command just now, and the text was OK -- no hidden characters were found.
But, while looking at the method names, I discovered that I had mis-typed one of the required method signatures: I had typed "outlineView:... numberOfchildrenForItem:", which contains two mistakes that I missed when proofreading. Can you see them? It should have been "outlineView:... numberOfChildrenOfItem:". When I typed it correctly just now, the error message went away. So thanks for forcing me to focus on the actual method names.
I've been a lawyer for a very long time, and lawyers are trained to be very good proofreaders. Unfortunately, in this case my legal training failed me, and the compiler didn't do a very good job of pointing out the actual nature of the error. It even mentioned all four required datasource methods when only one of them was missing. Here's an idea for an additional feature for the compiler: when a protocol-related error occurs, use some form of pattern matching to find terms in a developer's source code that are very similar to the missing required protocol method(s) and point out the possible misspelling.
|