Re: Why does Xcode define IBOutlet with @synthesize?
Re: Why does Xcode define IBOutlet with @synthesize?
- Subject: Re: Why does Xcode define IBOutlet with @synthesize?
- From: Charles Srstka <email@hidden>
- Date: Fri, 23 Sep 2011 17:47:18 -0500
On Sep 23, 2011, at 5:24 PM, Jerry Krinock wrote:
> When creating a new project in Xcode 4.1, I get a window which is declared in the app delegate as:
>
> @property (assign) IBOutlet NSWindow *window;
>
> and defined as
>
> @synthesize window ;
>
> Is this not going to create unnecessary unnecessary setter and getter implementations? Would not @dynamic be more appropriate in this situation?
Seems to me like a setter is the better way for an outside class (like NSBundle, NSNib, etc.) to set the outlet properties on the owner object. I know this used to work directly with ivars in the old days, but I’m still puzzled as to exactly how that worked. Was NSBundle really breaking encapsulation somehow and fiddling with objects’ ivars directly?
Charles_______________________________________________
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