Re: @dynamic stupidity?
Re: @dynamic stupidity?
- Subject: Re: @dynamic stupidity?
- From: Dave Carrigan <email@hidden>
- Date: Thu, 25 Feb 2010 19:19:53 -0800
On Feb 25, 2010, at 7:10 PM, William Squires wrote:
> Why doesn't it just @synthesize the accessors? What would happen if I replaced the @dynamic with @synthesize? Would it blow up, or just have weird performance issues?
@dynamic and @synthesize are completely different. @synthesize causes the compiler to implement a getter/setter that directly changes the class' ivar (or fakes it in the 64-bit runtime). @dynamic tells the compiler that there at runtime, there will be an implementation of the getter/setter for the property in question, so that the compiler doesn't give a warning about missing methods. Replacing one with the other would cause your program to fail.
You need to read
http://www.devworld.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html
--
Dave Carrigan
email@hidden
Seattle, WA, USA
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden