On Tue, 26 Aug 2014 16:34:30 +0300, Motti Shneor said:

>In my document NSWindowController, there are two references, to the 
>
>@property (atomic, readwrite, weak) NSManagedObject
>*currentDepartment; // and 
>@property (atomic, readwrite, weak) NSManagedObject *currentEmployee;
>
>(I know this example calls for using the table or array controller
>selection instead of those references, but my case has no "selection"
>per se. I need those "current" references, to which I apply actions and
>changes as the program runs.)

Instead of raw pointers to the NSManagedObjects as above, you should consider 
using an NSObjectController intermediary.  'selection' is not the only 
attribute of an NSObjectController, more importantly, it has a 'content', which 
you can swap almost as easily as you change your properties above.  
NSObjectController has magic to deal with its content object going away and 
reappearing that will help you.

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 s...@rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________

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