Re: Sending the "value" message to an object typed "id"
Re: Sending the "value" message to an object typed "id"
- Subject: Re: Sending the "value" message to an object typed "id"
- From: Graham Cox <email@hidden>
- Date: Tue, 8 Sep 2009 01:59:53 +1000
On 08/09/2009, at 1:31 AM, Paulo F. Andrade wrote:
At least from the UISlider class hierarchy there seems to be only
one method named "value", no ambiguity there.
A further point - it's not the immediate class hierarchy that is
searched. It's the entire namespace, which as you know is everything.
And because the compiler uses the first version it encounters, that
could well be a method buried deep in the low-level parts of any
framework that is visible.
To check this, disassemble the code that's calling -value. If it's not
using objc_msgSend_fpret then it's done the wrong thing. Compare the
disassembly with casting sender to (UISlider*), where it will use
objc_msgSend_fpret. Finding the actual method it has based its
compilation around is harder (and only of academic interest) - you'll
have to search the entire namespace.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden