Re: CD: subclassing NSArrayController
Re: CD: subclassing NSArrayController
- Subject: Re: CD: subclassing NSArrayController
- From: mmalcolm crawford <email@hidden>
- Date: Mon, 26 Sep 2005 18:41:40 -0700
On Sep 26, 2005, at 8:22 AM, Jesus De Meyer wrote:
I think I'm getting the hang of CoreData, but I'm still strugling
over something.
This isn't really specific to Core Data...
In my app, what I'd like to do is have a tableview that lists all
the objects that I have added. But instead of having a Master
Interface, I would like to have 2 buttons, add and remove. When I
would click on the add button, I would get a sheet with things I
can fill in and when I close the sheet, by clicking save or
something, this object should get added to the tableview.
What's the best way to do this? I was thinking of subclassing the
NSArrayController that represents my objects and override the add
method to show up a sheet. When I then click on save, I then call
[NSEntityDescription
insertNewObjectForEntityForName:inManagedObjectContext:context],
setup the values of the object to the ones from the TextFields and
other elements and close the sheet.
I assume you have a window/document controller with a managed object
context, an outlet to the window etc? Why not just implement a
suitable add: method on it to create the sheet, managed object etc?
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