Core date experimentation


#1

Hey,
i want to add some entries to the array at the start of the application.
i know i can use this method - (id)newObject to manipulate the object after it was added by the “Add” button and i know there is this method - (void)addObject:(id)object but if i trigger this method with the init method it doesn’t work i do not get an entry at the application start… why?!

i am a little bit confused with this core data and wonder where i can enter some code to the magic core data…
how is the array called? where can i directly interact with this array and can i create new instances of my entity by hand in my arrayController subclass “CarArrayController”?

Please help me. confused


#2

You want to trigger this in here:

- (void)windowControllerDidLoadNib:(NSWindowController *)aController { [super windowControllerDidLoadNib:aController]; // Add any code here that needs to be executed once the windowController has loaded the document's window. }

Once this fires odd, all of the objects which the WindowController has called are initialised. If you call it from the MyDocument’s init stage, nothing will happen as none of the objects exist yet (unless you manually create them).