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: Roland King <email@hidden>
- Date: Sat, 19 Jun 2010 00:25:27 +0800
have you tried putting the @synthesize after your hand-written method?
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