• 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: Why can't I name a property `tag'?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why can't I name a property `tag'?


  • Subject: Re: Why can't I name a property `tag'?
  • From: Graham Cox <email@hidden>
  • Date: Thu, 10 Jul 2008 23:31:10 +1000

I ran into this a while back. Basically if the method names only differ by return type and there is nothing else to go on (like a concrete object pointer type) the compiler, without complaining, plumps for the first one it can find, which invariably is Cocoa's built-in methods and not yours.

The return type is not part of the method signature.

You have two choices:

a) rename your property something else

b) type the object explicitly where used, and don't use id.


hth,

Graham




On 10 Jul 2008, at 11:25 pm, an0 wrote:

what makes XCode think the `tag' property of the item is an NSInteger?

_______________________________________________

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: Why can't I name a property `tag'?
      • From: an0 <email@hidden>
References: 
 >Why can't I name a property `tag'? (From: an0 <email@hidden>)

  • Prev by Date: Why can't I name a property `tag'?
  • Next by Date: Re: Why can't I name a property `tag'?
  • Previous by thread: Why can't I name a property `tag'?
  • Next by thread: Re: Why can't I name a property `tag'?
  • Index(es):
    • Date
    • Thread