Re: Undo Names in NSPersistentDocument

2009-12-28 Thread mlist0...@gmail.com
On Dec 18, 2009, at 8:39 PM, Graham Cox wrote: (regarding undo action names when using NSPersistentDocument) > Unfortunately I haven't used Core Data so I'm not sure what's needed to fit > in with that, if the framework hasn't already solved it. As near as I can tell, 5 years after Core Data's

Re: Undo Names in NSPersistentDocument

2009-12-19 Thread Graham Cox
On 19/12/2009, at 4:34 PM, Gerriet M. Denkmann wrote: > The documentation says: "Beginning with Mac OS X v10.4 the result of this > method is deferred until the next iteration of the runloop" > [] > Maybe GCUndoManager could implement: > - (void)setActionNameToBeUsedAtTheNextNonEmptyNamelessUn

Re: Undo Names in NSPersistentDocument

2009-12-18 Thread Jerry Krinock
On 2009 Dec 18, at 21:34, Gerriet M. Denkmann wrote: > I added in MyDocument.m: > > - (IBAction)add: sender; > { > [ [ self undoManager ] setActionName: @"Add" ]; > [ dictWordArrayController add: sender ]; > } > > and now got two Undo items: I presume you mean that you can click U

Re: Undo Names in NSPersistentDocument

2009-12-18 Thread Gerriet M. Denkmann
On 19 Dec 2009, at 11:39, Graham Cox wrote: > > On 19/12/2009, at 12:08 PM, Gerriet M. Denkmann wrote: > >> How would I do this? >> Subclass the NSArrayControllers and overrriding add: and remove: to call >> setActionName:? >> Or is there a simpler way? > > > My take on this is this: The act

Re: Undo Names in NSPersistentDocument

2009-12-18 Thread Graham Cox
On 19/12/2009, at 12:08 PM, Gerriet M. Denkmann wrote: > How would I do this? > Subclass the NSArrayControllers and overrriding add: and remove: to call > setActionName:? > Or is there a simpler way? My take on this is this: The action name is part of the View layer (because it appears in the

Undo Names in NSPersistentDocument

2009-12-18 Thread Gerriet M. Denkmann
I have a subclass of NSPersistentDocument. MyDocument.nib has two NSTableViews bound to NSArrayControllers and some + and - buttons connected to add: resp. remove: of these controllers. The table view are editable. And, without doing anything about it, everything is undoable. Very impressive. B