Re: Compiler can't find method declared in protocol
Re: Compiler can't find method declared in protocol
- Subject: Re: Compiler can't find method declared in protocol
- From: Greg Parker <email@hidden>
- Date: Tue, 18 Dec 2012 19:45:17 -0800
On Dec 18, 2012, at 8:46 AM, BlueBoy <email@hidden> wrote:
> You're missing the first argument name in the protocol method...
>
> - (void)tokenControl:(RPTokenControl*) <missingArgument>
> renameToken:(NSString*)token ;
That's right. If you forget the parameter variable name, you get a legal declaration of a method named `-tokenControl::`.
clang warns about this typo (or will soon - I can't remember if this warning is in Xcode 4.5 or 4.6). If you really wanted to declare `-tokenControl::` with `renameToken` as a parameter variable name, the compiler would insist that you add whitespace between `renameToken` and the following `:`.
- (void)tokenControl:(RPTokenControl*) renameToken:(NSString*)token; // warning, did you forget a parameter variable name?
- (void)tokenControl:(RPTokenControl*)renameToken :(NSString*)token; // no warning
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden