Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: call BOOL valued method from performSelector
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: call BOOL valued method from performSelector



On Feb 24, 2005, at 5:09 PM, YL wrote:

what the return value of
[myObj performSelector:@selector(aBoolValuedMethod)]
and how to convert it back to BOOL

When I do
BOOL yn = (BOOL)[myObj performSelector:@selector(aBoolValuedMethod)];

The compilor says "cast from pointer to integer of different size"

From objc.h:

	objc.h:typedef signed char              BOOL;

BOOL is a signed char, so you can't simply typecast a pointer; the char is 8 bits, and the pointer 32 (for now).

From the docs for -performSelector:

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

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Objc-language Digest, Vol 2, Issue 27 (From: Stephen Sebeny <email@hidden>)
 >call BOOL valued method from performSelector (From: "YL" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.