Re: NSUndoManager across multiple nibs
Re: NSUndoManager across multiple nibs
- Subject: Re: NSUndoManager across multiple nibs
- From: "Matt Ball" <email@hidden>
- Date: Fri, 31 Mar 2006 17:59:09 -0500
Yeah, I'm sure that currentDocument is correct. In my AppController,
the currentDocument is just:
- (id)currentDocument {
return [[NSDocumentController sharedDocumentController] currentDocument];
}
Jerry: That didn't work :/
Does anyone have some more advanced sample code than what I posted
that might show how people usually accomplish this?
Thanks,
Matt Ball
On 3/30/06, Derrick Bass <email@hidden> wrote:
> On Mar 30, 2006, at 5:49 PM, Matt Ball wrote:
>
> > I am working on a document-based app which has a main window with a
> > view for drawing in, and a palette with a tableview displaying the
> > various layers. I am implementing undo support in it right now, and
> > I've run into a snag.
> >
> > Actions generated by anything in the main window undo fine. However,
> > any actions generated by the layers palette do not get added to the
> > undo stack. In my layersController class, I have:
> > - (NSUndoManager *)undoManager {
> > return [[[NSApp delegate] currentDocument] undoManager];
> > }
> >
> > where currentDocument is a pointer to the current document in my
> > AppController class. Does anyone know what I need to do to get actions
> >
> I'm not really sure what's wrong; but, are you quite sure that
> currentDocument is really giving the right answer?
> NSDocumentController has a currentDocument method that you might want
> to use instead of trying to maintain your own pointer manually.
>
> Derrick
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden