• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
OutlineView, TreeController, Core Data - SaveAction
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OutlineView, TreeController, Core Data - SaveAction


  • Subject: OutlineView, TreeController, Core Data - SaveAction
  • From: Raimond Hettrich <email@hidden>
  • Date: Sat, 14 May 2016 15:49:05 +0200

Hallo All,


I have a view-based OutlineView  with one column bound to an TreeController (arrangedObjects) and the TableViewCell bound to objectValue.name. The TreeController is bound to the managedObjectContext.

Nearly everything is fine. With the Add-Button a new line  will be added with the default Value of my entity attributes. And with the Add Child Button a child will be added. The Remove-Butten removes the selected row. 

The only problem is, that I can’t save the values. The Save-Action in the AppDelegate is bound to the Save-Item of the File-Menu. If I tab cmd+s the file menu in the titlebar becomes blue. 

And the NSLog() I placed in the SaveAction shows that the action is called and no errors occur.

- (IBAction)saveAction:(id)sender {
    if (![[self managedObjectContext] commitEditing]) {
        NSLog(@"%@:%@ unable to commit editing before saving", [self class], NSStringFromSelector(_cmd));
    }

    

    NSError *error = nil;
    if ([[self managedObjectContext] hasChanges] && ![[self managedObjectContext] save:&error]) {
        [[NSApplication sharedApplication] presentError:error];
    }       

    NSLog(@"Save?");
}


But nothing will be saved. 

Many thanks for your help!

Kind regards,
Raycord  
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: debug play button disappears? bug or "feature" ??
  • Next by Date: Frameworks + git
  • Previous by thread: Re: debug play button disappears? bug or "feature" ??
  • Next by thread: Frameworks + git
  • Index(es):
    • Date
    • Thread