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 7616325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:51:38+00:00 2026-05-31T02:51:38+00:00

I have few Core Data projects for MacOS started with Xcode 3 that behaves

  • 0

I have few Core Data projects for MacOS started with Xcode 3 that behaves well in Xcode 4, especially for Undo/Redo management.
But now I started a new Core Data project from Xcode 4 and I’m facing problems with Undo: the Undo and Redo menu items are linked to the Undo:\Redo: methods of the First Responder, as happens for projects created by Xcode 3; but the menu was always disabled.
So I made a binding from the Enabled property of the menu items to managedObjectContext.undoManager.canUndo / canRedo: this enables the menu when the user makes a change to the objects, but anyway the undo action had no effect: the menu remains enabled but no undo was made.
The only way to obtain the undo was to break the connection of the menu items to the First Responder and instead make another one to new IBActions of the AppDelegate:

- (IBAction)myUndoAction:(id)sender  
{
    [[[self managedObjectContext] undoManager] undo];
}

- (IBAction)myRedoAction:(id)sender
{
    [[[self managedObjectContext] undoManager] undo];
}

In this way (and with the Enable properties bound to canUndo and canRedo) both menu items work as expected for Core Data objects; anyway I never had this problem with Xcode 3.

Does someone else face this problem with Xcode 4? I reinstalled Xcode 4.2.1 from scratch, to avoid old template problems, but I have the same problem again.
I don’t like to install also Xcode 3, just to start with a functioning project, then migrate the project to Xcode 4!
I googled and looked in every forum I know, also Apple discussions, but I didn’t find anything. I am on 10.7.2.


UPDATE
By linking Undo/Redo to the AppDelegate will break other operations, as the Undo/Redo will always call the NSUndoManager from the ManagedObjectContext, so the actions must remain linked to the First Responder.
I’ll have to stick to Xcode 3.2 to generate a core data project from scratch, then open it from Xcode 4 (as far as I’ll discover where the bug is, probably in the template…)

  • 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-05-31T02:51:39+00:00Added an answer on May 31, 2026 at 2:51 am

    I was able to work around this for myself by making my window controller implement the NSWindowDelegate protocol and have it relay windowWillReturnUndoManager: calls to the application’s delegate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Core Data document-based app which support undo/redo via the built-in NSUndoManager
I have a few int16 attributes of my core data entities, and I want
I have a core data model that has two entities, Bid and Result. I
I have a few projects coming up that have a number of endpoints or
I have a Core Data project with a sort of master entity that holds
I am new to core data therefore I have got few questions. I'll ask
I have a Core Data entity that uses a custom subclass of NSManagedObject. I
Say I have a core data model with a few entities and, throughout the
I have a few questions about Core Location. 1) Should the user refuse permission
I have been going through the core jQuery code and had a few why

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.