Re: noob question regarding proxy object returned by -selection method of NSArrayController
Re: noob question regarding proxy object returned by -selection method of NSArrayController
- Subject: Re: noob question regarding proxy object returned by -selection method of NSArrayController
- From: Keary Suska <email@hidden>
- Date: Sat, 28 Jun 2008 11:53:16 -0600
- Thread-topic: noob question regarding proxy object returned by -selection method of NSArrayController
6/28/08 11:43 AM, also sprach email@hidden:
> If I do this (have the update logic in the Person class), then I
> can't use the proxy object returned by the -selection method of the
> NSController (because the proxy object doesn't respond to the methods
> of the backing class).
>
> My question is: What is the best way to get the actual model entry,
> so such instance methods can be invoked?
I call [[arrayController selectedObjects] objectAtIndex:0] to get the actual
object.
> BTW: I have one solution, which is to send the controller a -
> selectionIndex message, and use the resulting index to directly
> access the backing store. But doing this is based on knowing what
> that backing content object is, which seems like I am using side
> knowledge in my appController, and so I wonder if there is a way to
> get the actual model content object directly from the
> NSArrayController....
Probably a bad idea. You can't guarantee the order unless, as you say, your
controller knows too much about the view. You could use the index but use it
on -arrangedObjects, however.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden