Re: Passing C Style Function Callbacks in Cocoa
Re: Passing C Style Function Callbacks in Cocoa
- Subject: Re: Passing C Style Function Callbacks in Cocoa
- From: Clark Cox <email@hidden>
- Date: Fri, 5 Mar 2004 14:30:34 -0500
On Mar 05, 2004, at 13:49, Alessandro Volz wrote:
>
On the same subject, here's my other question:
>
i am passing a @selector(boolReturningMethod:) and later invoking it
>
thru
>
BOOL b = [target performSelector:action withObject:whatever];
[snip]
>
BOOL b = (BOOL)[target performSelector:action withObject:whatever];
Don't do that!!!!!
You have no guarantee that that will continue to work in the future
(who says that pointers and BOOLs are returned in the same register?).
Only use -performSelector: (and friends) with methods that return a
pointer to an object.
--
Clark S. Cox III
email@hidden
http://homepage.mac.com/clarkcox3/
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.