Re: NSUndoManager but Undo and Redo Menu Items are Disabled?
Re: NSUndoManager but Undo and Redo Menu Items are Disabled?
- Subject: Re: NSUndoManager but Undo and Redo Menu Items are Disabled?
- From: joe OneNinetyTwo <email@hidden>
- Date: Sun, 13 Aug 2006 18:16:35 -0700 (PDT)
Okay. Solved my problem. It's a newbie mistake.
I instantiated my DataSet object in the nib (for
connections) but also in MyDocument init. So, I was
getting two objects instead of one. I just deleted
the allocation in MyDocument, cleaned up a bit, and it
works. And now I know better! :-)
--- joe OneNinetyTwo <email@hidden> wrote:
> I had NSMutableArray's of my model objects inside
> MyDocument. I was viewing these model objects with
> an NSTable in the window of MyDocument.nib. I
> have
> implemented Undo, and had everything working just
> fine.
>
> Then I decided to move the NSMutableArray's of my
> model objects into a class called DataSet. I alloc
> and init my model class DataSet inside MyDocument
> init
> with
>
> - (id) init
> {
> self = [super init];
> if (self) {
> dataSet = [[DataSet alloc] initWithUndoManager:
> [self undoManager]];
> }
> return self;
> }
>
> Inside DataSet class I send the
> prepareWithInvocationTarget message to the
> undoManager
> to load the stack, as before.
>
> Except now, the Undo and Redo menu items are
> disabled,
> and I can no longer undo and redo. Can anyone
> please tell me what I'm doing wrong here?
>
> Thanks,
>
> Philip
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
> _______________________________________________
> 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
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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