6/28/08 11:43 AM, also sprach [EMAIL PROTECTED]:

> 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to