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 9:16 AM, Kyle Sluder <email@hidden> wrote:

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

Correct. Please keep in mind that this behavior is only available in very recent versions of Xcode and the Apple LLVM compiler.

davez
 _______________________________________________
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

References: 
 >Re: Controlling the name of synthesized instance variables (From: Kyle Sluder <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.