• 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
Re: Core Data / Bindings Behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data / Bindings Behavior


  • Subject: Re: Core Data / Bindings Behavior
  • From: Jeff LaMarche <email@hidden>
  • Date: Wed, 8 Jun 2005 00:48:02 -0400

Been playing with this some more. Found a way to get it to preserve the edit, but it's a hack and it causes a selector not found message at runtime... but at least it works. Here's what I did:

// -----------------------------------------------------------------------------------------------
- (IBAction) saveAction:(id)sender 
// -----------------------------------------------------------------------------------------------
{
    id r = [[window firstResponder] delegate];
    if ([r isKindOfClass:[NSTextField class]])
    [r textDidChange:[NSNotification notificationWithName:@"Saving" object:self]];
    
    NSError *error = nil;
    if (![[self managedObjectContext] save:&error]) 
        [[NSApplication sharedApplication] presentError:error];

}

If anyone knows a "right" way to handle this situation, please let me know. I feel dirty doing this. =)

Jeff
 _______________________________________________
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

References: 
 >Core Data / Bindings Behavior (From: Jeff LaMarche <email@hidden>)
 >Re: Core Data / Bindings Behavior (From: Scott Stevenson <email@hidden>)
 >Re: Core Data / Bindings Behavior (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: Re: multi-platform binaries...
  • Next by Date: Newbie : C++ ?
  • Previous by thread: Re: Core Data / Bindings Behavior
  • Next by thread: Re: Core Data / Bindings Behavior
  • Index(es):
    • Date
    • Thread