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"
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 mails | Author | Date |
|---|---|---|
| Stuart Malin | Jun 28, 19:43 | |
| Keary Suska | Jun 28, 19:53 | |
| Ken Thomases | Jun 29, 09:07 | |
| Stuart Malin | Jun 29, 17:47 | |
| Ken Thomases | Jun 29, 18:04 |






Cocoa mail archive

