Re: Opening a window in Core Data application
Re: Opening a window in Core Data application
- Subject: Re: Opening a window in Core Data application
- From: "I. Savant" <email@hidden>
- Date: Fri, 31 Mar 2006 11:18:31 -0500
On Mar 31, 2006, at 10:42 AM, Wayne Pascoe wrote:
I think I understand it a lot better now, and I also think I
understand partly where I have been going wrong and why. I've been
trying to shove stuff into the ArrayController, as I have seen this
as my controller. This isn't the case - the automatically created
Alexandria_AppDelegate is the actual controller I should be using.
The ArrayController is actually part of the model, but I saw the
word controller and went for it :)
Well, no ... :-) The array controller *is* a controller (hence the
name). You can (and most likely will / probably should) have more
than one controller in your application. There's nothing wrong with
extending the array controller's functionality. Whether or not to put
things in your the app delegate (also a controller) depends on your
design and what you're trying to accomplish (more on this at the end
of this e-mail).
In my case, the archive screen should show the basics about the
archive, so I'll make that editable. The downside is that a single
archive could comprise of hundreds of files, so I think the master-
detail interface is not appropriate. An inspection panel might be
appropriate, but it will have to be scrollable / searchable because
of the potential number of files involved.
If you want to do an inspector-like thing, you could just
instantiate a new NSObjectController (not an array controller) by
dragging it into your nib, then bind its content to the array
controller's selection. Bind all your inspector's controls to the
*object controller* since this represents the current selection in
your list. When the user selects a different object to inspect, the
array controller's selection will change, which will change the
content of the inspector's object controller, which will update the
inspector's controls to reflect the new selection.
All this and more can be found in the fabulous Apple
documentation. :-)
In your particular case (if I recall correctly), given that you
want an inspector-like thing, you *could* configure the array
controller to -setSelectsInsertedObjects:YES (you can do it in
Interface Builder by checking a box, I believe), then create a
*separate* button / menu option to open the inspector. That way, the
user has a choice whether or not they want to see the inspector and,
if it's displayed, it'll automatically inspect the newly-inserted
object. So your "plus" button can remain connected to the array
controller's -add: method.
I know this contradicts my previous suggestion (which I believe I
gave you off-list), but I didn't have as much information on what you
were trying to accomplish. :-)
--
I.S.
_______________________________________________
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