Re: CoreData question
Re: CoreData question
- Subject: Re: CoreData question
- From: mmalcolm crawford <email@hidden>
- Date: Sun, 25 Sep 2005 06:39:00 -0700
On Sep 25, 2005, at 3:11 AM, Jesus De Meyer wrote:
I'm very new at CoreData. I'm trying to write some sort of database
application. I have setup the data model. Suppose for example that
I have an object called Movie and then another one called Genre.
When the application is started, I would like to have some
predefined Genres already, instead of having the user come up with
genres.
If you're using a document-based application:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
NSPersistentDocumentTutorial/04_Department/chapter_5_section_2.html#//
apple_ref/doc/uid/TP40001799-CH223-DontLinkElementID_25>
Otherwise there are several approaches; using the standard template
it's probably easiest to add a check in
- (NSManagedObjectContext *) managedObjectContext
to determine if the persistent store already exists, and it it
doesn't, add the Genre objects.
How would I do this? Do I need to create a class for the Genre and
then setup an ArrayController in IB that points to this class and
then have a TableView or Popupmenu get the data from this array
controller?
When making a class from an object in the data model, do I need to
use the following initializer?
<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/
Articles/cdCreateMOs.html#//apple_ref/doc/uid/TP40001654-208209>
- (id)initWithEntity:(NSEntityDescription*)entity
insertIntoManagedObjectContext:(NSManagedObjectContext*)context {
if (self = [super init]) {
//do some stuff
}
return self;
}
No. <http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaObjects/Articles/ObjectCreation.html#//apple_ref/doc/uid/
20002154-1006903-BCIEBFDC>
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