Re: CoreData question
Re: CoreData question
- Subject: Re: CoreData question
- From: Jesus De Meyer <email@hidden>
- Date: Sun, 25 Sep 2005 19:52:05 +0200
OK I have the following code:
- (id)initWithType:(NSString *)type error:(NSError **)error {
self = [super initWithType:type error:error];
if (self != nil) {
NSManagedObjectContext *managedObjectContext = [self
managedObjectContext];
NSManagedObject *aGenre = [NSEntityDescription
insertNewObjectForEntityForName:@"Genre"
inManagedObjectContext:managedObjectContext];
[aGenre setValue:@"Action" forKey:@"name"];
[aGenre setValue:@"Adventure" forKey:@"name"];
[aGenre setValue:@"Horror" forKey:@"name"];
[managedObjectContext processPendingChanges];
[[managedObjectContext undoManager] removeAllActions];
[self updateChangeCount:NSChangeCleared];
}
return self;
}
However, when I set up an NSTableView in IB which has the following
bindings:
- TableView: content->Bound to: Genre Array Controller,
ControllerKey: arrangedObjects, empty keypath
- TableColumn: value->Bound to: Genre AC, ControllerKey:
arrangedObjects, keypath: name
I can only see the last added genre, in this case Horror. Also, I
option dragged an object from my model to IB and told IB that I
wanted a UI for only one object, and when I launch my application,
all UI items (like textfields etc) are disabled. Do I need to do
something else?
Thanks in advance,
Jesus
_______________________________________________
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