• 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: BOOL returned via -performSelctor: not BOOL on 64-bit system
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BOOL returned via -performSelctor: not BOOL on 64-bit system


  • Subject: Re: BOOL returned via -performSelctor: not BOOL on 64-bit system
  • From: James Bucanek <email@hidden>
  • Date: Tue, 8 Jun 2010 11:18:56 -0700

Jean-Daniel Dupas <mailto:email@hidden> wrote (Tuesday, June 8, 2010 10:37 AM +0200):

Le 8 juin 2010 à 19:23, James Bucanek a écrit :


For the record, the following is equivalent (i.e. produces the same machine code) and is probably a little easier to read:

BOOL returnValue = (BOOL)((uintptr_t)[condition performSelector:conditionSelector]);

It's not more valid though. -performSelector must be used only with selector that return an object.

From the -performSelector reference:

"For methods that return anything other than an object, use NSInvocation."

I concede that you're technically correct. But pragmatically, the CPU register used to return integer and pointer values to the caller has always been the same register for both Motorola and Intel processors since as long as I can remember programming in C -- and that's been awhile.


--
James Bucanek

_______________________________________________

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


  • Follow-Ups:
    • Re: BOOL returned via -performSelctor: not BOOL on 64-bit system
      • From: Michael Ash <email@hidden>
References: 
 >Re: BOOL returned via -performSelctor: not BOOL on 64-bit system (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Erasing drawn content
  • Next by Date: Re: BOOL returned via -performSelctor: not BOOL on 64-bit system
  • Previous by thread: Re: BOOL returned via -performSelctor: not BOOL on 64-bit system
  • Next by thread: Re: BOOL returned via -performSelctor: not BOOL on 64-bit system
  • Index(es):
    • Date
    • Thread