• 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
create managed object programmaticly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: create managed object programmaticly
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: cancelOperation: does not work for trapping the escape key
  • Next by Date: Re: cancelOperation: does not work for trapping the escape key
  • Previous by thread: Re: cancelOperation: does not work for trapping the escape key
  • Next by thread: Re: create managed object programmaticly
  • Index(es):
    • Date
    • Thread