On Mar 17, 2012, at 6:10 PM, Richard Somers wrote:

> On Mar 17, 2012, at 6:12 PM, Roland King wrote:
> 
>> So often I find I start with 
>> 
>> @synthesize foo=_foo;
>> 
>> and by the time I get to the end of the project I've written custom foo: and 
>> setFoo: methods which do something else too. 
> 
> I have also done that but I recently read a blog where the writer recommends 
> "Do not override @synthesized properties with your own code: use @dynamic 
> properties instead ...".
> 
>     http://wiki.akosma.com/Objective-C_Code_Standards
> 
> I would be curious if anyone else has an opinion on that one way or the other.

If you define methods foo and setFoo:, you don't need to use @dynamic or 
@synthesize (but I doubt it hurts). I think @dynamic tends to be used in 
situations where you want to promise the compiler that these will be 
implemented, but the compiler cannot determine that while parsing the source (I 
think these arise in Core Data).

Aaron




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to