• 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: Displaying Core Data using Cocoa binding programmatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying Core Data using Cocoa binding programmatically


  • Subject: Re: Displaying Core Data using Cocoa binding programmatically
  • From: George Orthwein <email@hidden>
  • Date: Sat, 13 May 2006 14:38:37 -0400

Yeah, it still sounds like a bindings setup problem to me... which leads me to wonder if you tried the option-drag GUI test. :) I just think it's great for debugging and checking how stuff should be setup. Whoever thought that up at Apple has my gratitude.

In my experience, the NSArrayController should "just work"— insertNewObjectForEntityForName: should be all that is needed for the object to appear in the appropriately bound table views. Or at least it should in the very simple case you've described. So if the data is being created... then that just leaves the controller and binding setup.

The only thing I saw in your code is that you refer to the MOC once as [appDelegateObj managedObjectContext] and once as [self managedObjectContext]. If appDelegateObj is pointing to something else that could be the problem.

But I created a new Core Data project, created an entity with a single attribute, option-dragged it into IB and added the following awakeFromNib to the existing AppDelegate file and saw no problems.

- (void)awakeFromNib;
{
NSManagedObject * myObj = [NSEntityDescription insertNewObjectForEntityForName:@"Entity"
inManagedObjectContext:[self managedObjectContext]];
[myObj setValue:@"testing" forKey:@"name"];
[[self managedObjectContext] save:NULL];
}


So something must be set up a little differently in your case.

George


_______________________________________________ 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
  • Follow-Ups:
    • Re: Displaying Core Data using Cocoa binding programmatically
      • From: "Bill So" <email@hidden>
References: 
 >Displaying Core Data using Cocoa binding programmatically (From: "Bill So" <email@hidden>)
 >Re: Displaying Core Data using Cocoa binding programmatically (From: George Orthwein <email@hidden>)
 >Re: Displaying Core Data using Cocoa binding programmatically (From: "Bill So" <email@hidden>)

  • Prev by Date: Re: find - sort - locate.big...
  • Next by Date: Re: compressing an NSString
  • Previous by thread: Re: Displaying Core Data using Cocoa binding programmatically
  • Next by thread: Re: Displaying Core Data using Cocoa binding programmatically
  • Index(es):
    • Date
    • Thread