Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8904523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:09:16+00:00 2026-06-15T02:09:16+00:00

Working through the book Cocoa Programming for Mac OS X (third edition) from Aaron

  • 0

Working through the book Cocoa Programming for Mac OS X (third edition) from Aaron Hillegass I am now at Chapter 9, at the end of section Adding Undo to RaiseMan. Hillegass tells you to add two methods to your class MyDocument and then build the app to see that undo/redo is added and working.

But, it isn’t working (why else would I be here?). It says:

2012-11-27 19:55:16.231 RaiseMan[293:a0f] HIToolbox: ignoring exception 'undo: NSUndoManager 0x100188a30 is in invalid state, undo was called with too many nested undo groups' that raised inside Carbon event dispatch
(
    0   CoreFoundation                      0x00007fff88c26784 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x00007fff858ddf03 objc_exception_throw + 45
    2   CoreFoundation                      0x00007fff88c265a7 +[NSException raise:format:arguments:] + 103
    3   CoreFoundation                      0x00007fff88c26534 +[NSException raise:format:] + 148
    4   Foundation                          0x00007fff86fd0e17 -[NSUndoManager undo] + 239
    5   AppKit                              0x00007fff8976eeda -[NSApplication sendAction:to:from:] + 95
    6   AppKit                              0x00007fff8979346a -[NSMenuItem _corePerformAction] + 365
    7   AppKit                              0x00007fff897931d4 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 121
    8   AppKit                              0x00007fff89a18cf4 -[NSMenu _internalPerformActionForItemAtIndex:] + 35
    9   AppKit                              0x00007fff898ca9e9 -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 136
    10  AppKit                              0x00007fff8977599c NSSLMMenuEventHandler + 321
    11  HIToolbox                           0x00007fff83d937f7 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1002
    12  HIToolbox                           0x00007fff83d92d46 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 395
    13  HIToolbox                           0x00007fff83db0a81 SendEventToEventTarget + 45
    14  HIToolbox                           0x00007fff83ddfc35 _ZL18SendHICommandEventjPK9HICommandjjhPKvP20OpaqueEventTargetRefS5_PP14OpaqueEventRef + 387
    15  HIToolbox                           0x00007fff83e0ca0a SendMenuCommandWithContextAndModifiers + 56
    16  HIToolbox                           0x00007fff83e0c9c2 SendMenuItemSelectedEvent + 101
    17  HIToolbox                           0x00007fff83e0c8d2 _ZL19FinishMenuSelectionP13SelectionDataP10MenuResultS2_ + 150
    18  HIToolbox                           0x00007fff83dedc27 _ZL14MenuSelectCoreP8MenuData5PointdjPP13OpaqueMenuRefPt + 467
    19  HIToolbox                           0x00007fff83ded37c _HandleMenuSelection2 + 453
    20  AppKit                              0x00007fff89646851 _NSHandleCarbonMenuEvent + 236
    21  AppKit                              0x00007fff8961a362 _DPSNextEvent + 1908
    22  AppKit                              0x00007fff89619801 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
    23  AppKit                              0x00007fff895df68f -[NSApplication run] + 395
    24  AppKit                              0x00007fff895d83b0 NSApplicationMain + 364
    25  RaiseMan                            0x000000010000160a main + 33
    26  RaiseMan                            0x0000000100001218 start + 52
    27  ???                                 0x0000000000000001 0x0 + 1
)

in the console when I click undo or press cmd+z.

I found solutions for this online, but they are all about ‘UndoGroups’ or something similar.
I know that the exception is about nested undo groups, but I don’t use them (AFAIK), I don’t even know what they are.

I don’t know what else information I should give, so please ask in the comments for code fragments etc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:09:17+00:00Added an answer on June 15, 2026 at 2:09 am

    For future readers:

    Hillegass tells you to add 2 methods: -insertObject:inEmployeesAtIndex: and -removeObjectFromEmployeesAtIndex:. In the second method you have to do:

    NSUndoManager *undo = [self undoManager];
    [[undo prepareWithInvocationTarget:self] insertObject:p inEmployeesAtIndex:index];
    

    But I did:

    NSUndoManager *undo = [self undoManager];
    [[undo prepareWithInvocationTarget:self] insertObject:p atIndex:index]; //atIndex: instead of inEmployeesAtIndex:
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning objective-c, working through Aaron Hillegass' book Cocoa Programming for Mac OS X
I'm working through Aaron Hillegass' book, specifically the lottery example. I had a question
I've been learning Objective-C and Cocoa by working my way through the Hillegass book
I'm new to Cocoa, and working my way through Hillegass's book. I'm having trouble
I'm working through the 4th ed. of the Hillegass/Preble Cocoa book and have hit
I am working through the book Cocoa Design Patterns by Buck and Yacktman and
I'm new to Cocoa/Cocoa Touch, and working through a development book. I've come across
I'm working through the book Real-World Functional Programming , and I tried to come
I am working through the book Learning OpenCV from the O'Reilly series and am
I'm working through a jQuery book and am currently on the chapter of table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.