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 (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:
http://lists.apple.com/mailman/options/cocoa-dev/adam%40thejenkins.org

This email sent to [EMAIL PROTECTED]

_______________________________________________

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

This email sent to [EMAIL PROTECTED]

Reply via email to