• 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
Dynamic getting of a property of BOOL type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dynamic getting of a property of BOOL type


  • Subject: Dynamic getting of a property of BOOL type
  • From: Brad O'Hearne <email@hidden>
  • Date: Fri, 6 Mar 2009 11:35:26 -0700

I am dynamically retrieving properties from an NSObject, in order to convert the types to string values and store them in XML. I am using the following line of code to send a message to the object to retrieve the property's value:

id value = objc_msgSend(object, propSelector);
BOOL booleanValue = (BOOL)value;

The problem I am having is that I'm getting a warning on the second line. I've tried a number of variations, including:

BOOL booleanValue = value;

both of which give the following warning:

warning:  cast from pointer to integer of different size

How can I properly convert this id returned from the dynamic invocation of the property getter to the BOOL value that it actually is?

Thanks,

Brad
_______________________________________________

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: Dynamic getting of a property of BOOL type
      • From: "Paul Sanders" <email@hidden>
    • Re: Dynamic getting of a property of BOOL type
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: interpretKeyEvents not handling HOME and END keys?
  • Next by Date: Re: interpretKeyEvents not handling HOME and END keys?
  • Previous by thread: Re: Newbie query re notifications -- SOLVED
  • Next by thread: Re: Dynamic getting of a property of BOOL type
  • Index(es):
    • Date
    • Thread