Skip navigation.
 
mlRe: noob question regarding proxy object returned by -selection method of NSArrayController
FROM : Keary Suska
DATE : Sat Jun 28 19:53:16 2008

6/28/08 11:43 AM, also sprach <email_removed>:

> 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"

Related mailsAuthorDate
mlnoob question regarding proxy object returned by -selection method of NSArrayController Stuart Malin Jun 28, 19:43
mlRe: noob question regarding proxy object returned by -selection method of NSArrayController Keary Suska Jun 28, 19:53
mlRe: noob question regarding proxy object returned by -selection method of NSArrayController Ken Thomases Jun 29, 09:07
mlRe: noob question regarding proxy object returned by -selection method of NSArrayController Stuart Malin Jun 29, 17:47
mlRe: noob question regarding proxy object returned by -selection method of NSArrayController Ken Thomases Jun 29, 18:04