• 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: method naming
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: method naming


  • Subject: Re: method naming
  • From: Bill Bumgarner <email@hidden>
  • Date: Tue, 29 Jul 2008 20:16:07 -0700

On Jul 29, 2008, at 7:41 PM, Torsten Curdt wrote:
So I did't get why this should be ambiguous because NSApp obviously can't be of type id. Well turns out - it actually is. And now it all makes sense again :)

I've just replaced [NSApp ..] with [[NSApplication sharedApplication] ...]

Glad you have a solution!

NSApp is of type (id) because it is not uncommon -- though not the rule, either -- that applications will subclass NSApplication as their primary application class (settable in the build settings inspector of your Application's target in XCode).

Thus, by typing it of type (id), the compiler will complain of ambiguities like the one you encountered.

In general, there shouldn't be any such ambiguities. Objective-C does not mangle the names together with the argument types. There is a single flat namespace for all method names in your application's runtime. The "name" is just the selector, no argument types.

b.bum

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: 
 >Re: method naming (From: Charles Steinman <email@hidden>)
 >Re: method naming (From: Torsten Curdt <email@hidden>)

  • Prev by Date: Re: private methods and variables
  • Next by Date: Re: private methods and variables
  • Previous by thread: Re: method naming
  • Next by thread: NSTextFieldCell - Kidnapped Focus Ring!
  • Index(es):
    • Date
    • Thread