Re: Using Properties at Outlets
Re: Using Properties at Outlets
- Subject: Re: Using Properties at Outlets
- From: Adam P Jenkins <email@hidden>
- Date: Thu, 17 Apr 2008 18:49:53 -0400
The only potential problem I can see with this is whether IB will use
the generated accessor methods to set the outlets, or if it will just
access the ivars directly. If it does the latter, then no property
change notifications will be sent to observers when IB sets the
outlet. If that's not a problem for you then this should work fine in
any case.
Adam
On Apr 14, 2008, at 12:46 AM, Steve Sheets wrote:
Has anyone had any problems with creating Properties with Objective-
C 2.0 that are also Outlets?
I been using this inside my code, and I want to be sure there is no
problems with this. I create fairly standard (readonly) and
(readwrite, copy) properties using ivars, @property and @synthesize.
I place IBOutlet in front of the ivar like thus:
IBOutlet NSView* myView;
IBOutlet NSWindow* myWindow;
...
@property (readwrite, retain) NSView* myView;
@property (readonly) NSWindow* myWindow;
...
@synthesize myView;
@synthesize myWindow;
Sometimes the view or window are used as Outlets by the nib file,
and other times the code creates them on the fly.
The documentation does not explicitly say you can do this. I just
want to know if anyone has seen an issue?
Thanks,
Steve Sheets
_______________________________________________
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
_______________________________________________
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