|Aug 1, 2012, 03:48 AM||#1|
How to check if an object is NSObject or CFTypeRef
I have an object of type (id). This object is either a ABRecordRef, or an instance of a class that is subclass of NSObject.
How do i determine the real type of this object ?
|Aug 1, 2012, 05:08 AM||#3|
ABRecordRef is a C type - it should not be stored in the ObjC type "id"!
Normally, if you want to test if an ObjC object is a particular class, you do it like the following:
"if ([obj isKindOfClass: [MyObjCClass class]]) ..."
But again, you should not be calling isKindOfClass (or any other ObjC method) on an instance of ABRecordRef - it is not an ObjC type.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Resolved: How do I convert an NSData object to an NSDictionary object, and vice versa?||moonman239||iPhone/iPad Programming||6||May 2, 2014 01:17 PM|
|How to check log files to date/time system RAM was changed? Any way to check this?||asterix2k10||OS X||1||Mar 7, 2014 08:19 PM|
|When do you not need to declare an object?||thedon1||iPhone/iPad Programming||4||Jul 1, 2013 07:56 AM|
|The I may go to bed, and just check back in tomorrow to check my order status thread||lsutigerfan1976||iPhone||0||Sep 14, 2012 10:50 PM|
|Need advice - Check NSString object to see if its a valid word?||animefx||iPhone/iPad Programming||9||Aug 31, 2012 03:02 PM|
All times are GMT -5. The time now is 05:42 PM.