• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sending the "value" message to an object typed "id"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sending the "value" message to an object typed "id"


  • Subject: Re: Sending the "value" message to an object typed "id"
  • From: "Paulo F. Andrade" <email@hidden>
  • Date: Mon, 7 Sep 2009 17:10:10 +0100

Got it.

Thank you!

Paulo F. Andrade



On 2009/09/07, at 16:51, Graham Cox wrote:

Yes, but the return type will cause different compilation of objc_msgSend. There are several variants of that (obc_msgSend_fpret, objc_msgSend_stret, etc) depending on which registers are expected to return what sorts of values - structs vs. floats vs. integers/ objects for example. So the right method will get called but within the wrong context of what will be returned. You can verify this yourself by disassembling some variants of calling a test method - if only the return type varies and the compiler can't disambiguate based on class of the receiver, it will compile the first version it finds.

What's probably occurring in your case is that the compiler has used a version (such as -(id) value) that returns its value in a certain register, whereas the -(float) value method returns it in a different register (an fp register, generally). It just so happens that the register that the caller pulls the result from holds the slider object.

_______________________________________________

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


References: 
 >Sending the "value" message to an object typed "id" (From: "Paulo F. Andrade" <email@hidden>)
 >Re: Sending the "value" message to an object typed "id" (From: Graham Cox <email@hidden>)
 >Re: Sending the "value" message to an object typed "id" (From: "Paulo F. Andrade" <email@hidden>)
 >Re: Sending the "value" message to an object typed "id" (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Weird malloc error when dealing with lots of NSImage objects
  • Next by Date: mouseDown Event Position Accuracy (was: NSString drawAtPoint and vertical font alignment)
  • Previous by thread: Re: Sending the "value" message to an object typed "id"
  • Next by thread: Re: Sending the "value" message to an object typed "id"
  • Index(es):
    • Date
    • Thread