• 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: Is there a warning for this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a warning for this?


  • Subject: Re: Is there a warning for this?
  • From: Brian Bruinewoud <email@hidden>
  • Date: Fri, 25 Dec 2009 11:40:13 +1100

On 25/12/2009, at 01:20 , Kyle Sluder wrote:

> On Dec 24, 2009, at 3:26 AM, Brian Bruinewoud <email@hidden> wrote:
>
>> Is there some way to turn on a warning saying 'you are directly accessing an ivar where a (non-trivial) getter/setter exists'?
>
> I'm assuming you're targeting iPhone OS.
>
> If you can deal with not running your code in the simulator, switching to synthesized ivars where possible might avoid this situation in most cases, since you would either need self. or self-> to access the property/ivar. Otherwise, give your ivars a prefix (underscore is verboten according to Apple, since they use it in the frameworks).
>
> Oh, and if not being able to use the new runtime (and therefore synthesized ivars) in the simulator bothers you, file a bug. Same with the lack of namespacing leading to rules like "thou shalt not prefix identifiers with underscores." If enough of us complain about something, Apple might take our opinions into consideration.
>
> --Kyle Sluder

Thanks Kyle and Alexander.

I am indeed targeting iPhone OS in this particular example, though I didn't think that was particularly relevant. Would your answer change if I wasn't (other than discussing the simulator's limitations, obviously)?

Looks like I'll get into the habit of giving iVars a prefix or using synthesis where possible.

Thanks,
Brian._______________________________________________

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: 
 >Is there a warning for this? (From: Brian Bruinewoud <email@hidden>)
 >Re: Is there a warning for this? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Releasing Objects
  • Next by Date: Re: NSTableview datasource issues
  • Previous by thread: Re: Is there a warning for this?
  • Next by thread: Re: Is there a warning for this?
  • Index(es):
    • Date
    • Thread