Re: Xcode 3.2.3: cannot pair a synthesized setter/getter with a user defined setter/getter
Re: Xcode 3.2.3: cannot pair a synthesized setter/getter with a user defined setter/getter
- Subject: Re: Xcode 3.2.3: cannot pair a synthesized setter/getter with a user defined setter/getter
- From: Gerd Knops <email@hidden>
- Date: Fri, 18 Jun 2010 12:50:16 -0500
On Jun 18, 2010, at 11:25 AM, Roland King wrote:
> have you tried putting the @synthesize after your hand-written method?
>
That doesn't work.
I have decided that this warning is counter-productive. When I implement a setter, clang shouldn't care.
As is, when I implement a setter I have to remember to change the property declaration. And worse, if I decide I no longer need the setter, I have to remember to change the property declaration again, or risk hard to diagnose threading problems.
So I want to disable that warning, but can't seem to figure out how. I tried
-Wno-warn-atomic-property-rule
but that just gives me "warning: unknown warning option" for each file...
Any ideas?
Thanks
Gerd
> On 19-Jun-2010, at 12:21 AM, Gerd Knops wrote:
>
>> I just installed Xcode 3.2.3, and now in my project compiled with LVM/Clang I get lots of these warnings (code builds and runs fine in previous Xcode/compiler versions):
>>
>> warning: writable atomic property 'someProperty' cannot pair a synthesized setter/getter with a user defined setter/getter
>>
>> This is in cases where I use @synthesize, but provide a custom getter and rely on @synthesize to produce the setter (or vica versa).
>>
>> So basically in the header I have:
>>
>> @property (retain) SomeClass *someProperty;
>>
>> and in the implementation:
>>
>> @synthesize someProperty;
>> - (SomeClass *)someProperty {
>>
>> if(!someProperty)
>> {
>> someProperty=[[self createSomeProperty]retain];
>> }
>>
>> return someProperty;
>> }
>> // No setter, let @synthesize provide it
>>
>> I get a warning for my custom getter.
>>
>> How can I code this to not get a warning? I really would like to avoid writing setters where I don't need a custom behavior.
>>
>> Thanks
>>
>> Gerd
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Xcode-users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden