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

Low Level (mid-level) Core Data problems


  • Subject: Low Level (mid-level) Core Data problems
  • From: Barry Wilson <email@hidden>
  • Date: Mon, 15 May 2006 18:31:12 -0700

Hi,

I have a core data application that I am going to populate with data by parsing text files. I've already built an application in Cocoa and tested *most* of the user interface - at least the part that's relevant to my current task.

So I decided to use a command line program to parse and build the document following more or less the Low Level Core Data tutorial except for the part where the managed object model is created manually I used:

mom = [[NSManagedObjectModel alloc] initWithContentsOfURL:)modelURL];

where modelURL refered to the model in my application's bundle (which is where this command line tool is as well) .

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. The file I am creating shows up (but empty), so I am pretty sure the context is setup ok. So I am wondering why I can't alloc an object there. Is there some conflict? (I am also using yacc and lex with my YYSTYPE defined as CStringRef's which seems to work alright.).

I've looked at everything I can think of and I must be missing something really obvious. Any ideas?

-Barry





_______________________________________________
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: Low Level (mid-level) Core Data problems
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: sound a bell
  • Next by Date: More Mac like handling of OS raised exceptions
  • Previous by thread: Re: sound a bell
  • Next by thread: Re: Low Level (mid-level) Core Data problems
  • Index(es):
    • Date
    • Thread