• 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: Torsten Curdt <email@hidden>
  • Date: Wed, 30 Jul 2008 04:41:23 +0200

The compiler doesn't know what class the object belongs to. You're sending the message either to a variable of type id or the result of a method that returned id.The id type can hold any class, so if there are two identically named methods with different signatures (BOOL return type vs. void, for instance), it doesn't have enough information to pick the right signature.

That would make sense but it was complaining on

  [NSApp reportException: x];

And some other class just has

 -(BOOL)reportException:(NSException*)e;

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] ...]

Thanks guys!

cheers
--
Torsten
_______________________________________________

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


  • Follow-Ups:
    • Re: method naming
      • From: Bill Bumgarner <email@hidden>
References: 
 >Re: method naming (From: Charles Steinman <email@hidden>)

  • Prev by Date: Checking for hackintosh
  • Next by Date: Re: private methods and variables
  • Previous by thread: Re: method naming
  • Next by thread: Re: method naming
  • Index(es):
    • Date
    • Thread