• 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: Low Level (mid-level) Core Data problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Low Level (mid-level) Core Data problems


  • Subject: Re: Low Level (mid-level) Core Data problems
  • From: mmalcolm crawford <email@hidden>
  • Date: Tue, 16 May 2006 10:30:05 -0700


On May 15, 2006, at 6:31 PM, Barry Wilson wrote:

I created the context with the file name I want for the document. Everything seemed to be going ok until the part where I actually created objects and inserted them into the context. Except for the fact that it is in a function instead of the main.c, my code looks essentially like the code in the tutorial:
NSEntityDescription *kwEntity = [[managedObjectModel() entitiesByName] objectForKey:@"Keyword"];
Keyword *kw = [[[Keyword alloc] initWithEntity:kwEntity insertIntoManagedObjectContext:managedObjectContext()] autorelease];

[kw setValue:(NSString *) keyword forKey:@"name"]; // can't setValue because kw is null


Basically the kw object is always null. I've checked the entity and it appears OK, and I have used the Cocoa application to insert these same kinds of objects.

Has the persistent store coordinator been configured to use the model? Put another way, can you retrieve the Keyword entity using:

NSManagedObjectContext *moc = managedObjectContext();
NSManagedObjectModel *mom = [[moc persistentStoreCoordinator] managedObjectModel];
NSEntityDescription *kwEntity = [[mom entitiesByName] objectForKey:@"Keyword"];


mmalc


_______________________________________________ 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: 
 >Low Level (mid-level) Core Data problems (From: Barry Wilson <email@hidden>)

  • Prev by Date: Re: Is NSPopUpButton KVO compliant?
  • Next by Date: Fwd: More Mac like handling of OS raised exceptions
  • Previous by thread: Low Level (mid-level) Core Data problems
  • Next by thread: More Mac like handling of OS raised exceptions
  • Index(es):
    • Date
    • Thread