create managed object programmaticly
create managed object programmaticly
- Subject: create managed object programmaticly
- From: Dominik Pich <email@hidden>
- Date: Tue, 18 Dec 2007 18:59:18 +0100
Hi,
following (partly) the core data low level tutorial I tried created a
managed object for my custom entity by code.
It looks ok but crashes in the 2. NSLog.... well maybe because I use
garbage collection?
code:
- (IBAction)saveJobInHistory:(id)sender {
id destinationObject = [NSEntityDescription
insertNewObjectForEntityForName:[historyController entityName]
inManagedObjectContext:[historyController managedObjectContext]];
if(destinationObject) {
NSLog(@"got instance of entity");
NSLog([destinationObject description]);
}
}
historyController is btw an array controller and has the right entity
set. The context is non nil in any case :)
Im a core data noob and would be grateful for any advice :)
Dominik
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden