Re: BOOL returned via -performSelctor: not BOOL on 64-bit system
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