Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Controlling the name of synthesized instance variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Controlling the name of synthesized instance variables



On Apr 6, 2012, at 8:43 AM, Sam Deane <email@hidden> wrote:

> Is there any plan to add a way to control the naming convention used when @synthesize causes an instance variable to be synthesized?
>
> I'd love to be able to provide a naming rule - e.g for property p, the variable should be _p - and have it applied to all synthesized variables.
>
> It's a bit daft having to go through this dance endlessly:
>
>    @synthesize myProperty = _myProperty;
>    @synthesize otherProperty = _otherProperty;

Synthesize by default will make leading underscore the default if you omit the @synthesize altogether. If you want to choose something else, you can use a @synthesize directive as you currently do.

--Kyle Sluder

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.