• 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
Re: CoreData question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: CoreData question
      • From: Jesus De Meyer <email@hidden>
References: 
 >CoreData question (From: Jesus De Meyer <email@hidden>)
 >Re: CoreData question (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Screenshots using Cocoa
  • Next by Date: Re: Screenshots using Cocoa
  • Previous by thread: Re: CoreData question
  • Next by thread: Re: CoreData question
  • Index(es):
    • Date
    • Thread