• 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: Jean-Daniel Dupas <email@hidden>
  • Date: Thu, 10 Jul 2008 18:21:06 +0200


Le 10 juil. 08 à 17:52, Graham Cox a écrit :

Actually it doesn't emit a warning.

If you recall my problem a few weeks ago with:

- (float) position;

vs.

- (int) position;

the compiler sailed blithely on without a mention, generating code that smashed the stack to pieces.

This is different from the situation that does emit a warning, where the method is completely unknown and is assumed to return type 'id'. I do compile with many additional warnings, but I haven't found one that picks up this problem.

Graham


The compiler will not try to search any -position method in headers you do not include in your file.
If you include more than one interface with different declaration it will tell you like this:


warning: multiple methods named '-position' found
/System/Library/Frameworks/Foundation.framework/Headers/ NSScriptObjectSpecifiers.h:191: warning: using '- (NSInsertionPosition)position'
AYPlayer.m:21: warning: also found '-(int)position'
AYPlayer.m:16: warning: also found '-(float)position'
/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h:139: warning: also found '-(CGPoint)position'


and it your try to do

CGPoint pos = [(id)foo position] it will even trigger an error.


_______________________________________________

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: Graham Cox <email@hidden>
References: 
 >Why can't I name a property `tag'? (From: an0 <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: Graham Cox <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: an0 <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: "I. Savant" <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: an0 <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: an0 <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: Jens Alfke <email@hidden>)
 >Re: Why can't I name a property `tag'? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: garbage collection and NSConnection
  • Next by Date: Problem copying pdfImageRep to bitmapRep.
  • Previous by thread: Re: Why can't I name a property `tag'?
  • Next by thread: Re: Why can't I name a property `tag'?
  • Index(es):
    • Date
    • Thread