• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Compiler can't find method declared in protocol
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Compiler can't find method declared in protocol (From: Jerry Krinock <email@hidden>)
 >Re: Compiler can't find method declared in protocol (From: BlueBoy <email@hidden>)

  • Prev by Date: Copy problem
  • Next by Date: Modern-day color spaces
  • Previous by thread: Re: Compiler can't find method declared in protocol
  • Next by thread: implementing relaunch in a sandboxed app
  • Index(es):
    • Date
    • Thread