Re: NSControllerObjectProxy
Re: NSControllerObjectProxy
- Subject: Re: NSControllerObjectProxy
- From: Jonathan Fewtrell <email@hidden>
- Date: Thu, 19 May 2005 10:30:25 +0100
<x-tad-bigger>I had a similar case involving a button that sent an action to a certain target using bindings. The button's 'argument' binding was tied to the 'selection' of an NSArrayController. The object passed was of type _NSControllerObjectProxy. In my case I got the 'real' object to be passed instead, simply by putting 'self' in the Model Key Path field (rather than leaving it blank).
Not sure whether this works in all situations though.
Jon
</x-tad-bigger>
<x-tad-bigger>FROM : Jiva DeVoe
DATE : Thu May 19 05:22:42 2005
Yes, that doesn't work...
I've asked on here before about this - this has been driving me crazy
for months! This seems like a fundamental flaw in using bindings (or
in my understanding of using them).
On May 18, 2005, at 7:57 PM, Bob Ippolito wrote:
</x-tad-bigger><x-tad-bigger>></x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>> On May 18, 2005, at 9:58 PM, Jiva DeVoe wrote:</x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>></x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>></x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>> When I bind a custom view to an NSArrayController's "selection" </x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>> property, the thing I get in my </x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>> "observeValueForKeyPath:ofObject:change:context" method winds up </x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>> being an NSControllerObjectProxy and *not* an instance of the </x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>> objects that are actually in my array - therefore, I have to </x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>> access all my properties on that object using valueForKey.</x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>></x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>> What I want to be able to do is access the actual methods on my </x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>> object. How can I do this? Is there some way to get at the </x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>> actual object from an NSControllerObjectProxy?</x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>>></x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>></x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>> Have you tried:</x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>></x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>> id realObject = [foo self];</x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>></x-tad-bigger><x-tad-bigger>
</x-tad-bigger><x-tad-bigger>> -bob</x-tad-bigger>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden