Hi all.

Since it is good programming to not access an array's content through its controller when in the model I'm trying to find a way to get to the same object selected in the user interface (i.e. the array controller).

In my view I have the array content sorted by binding it to a sort descriptor. Thus, the indices of the array and the content of the array shown in the view differs.

Now, when a certain object is selected in the view I want to do something to this object by accessing it through the original array. My first, perhaps foolish, guess would be to use indexOfObjectIdenticalTo: or indexOfObject: like this:

int indexOfObject = [theOriginalArray indexOfObjectIdenticalTo: [theArrayController selection]];

but this does not work. Looking in the reference I see that [theArrayController selection] will return a proxy object. Is this the reason my code won't work?

How would you solve this?

/wamund
_______________________________________________

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