Re: Low Level (mid-level) Core Data problems
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