Re: How to synchronize my MacOS-X application with Core-Data automatic Undo management?
Re: How to synchronize my MacOS-X application with Core-Data automatic Undo management?
- Subject: Re: How to synchronize my MacOS-X application with Core-Data automatic Undo management?
- From: Sean McBride <email@hidden>
- Date: Tue, 26 Aug 2014 11:57:11 -0400
- Organization: Rogue Research Inc.
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 email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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