id is simply void *. If you meant what is the class of object currently being pointed to you can simply ask it:
Code:
id someObject;
// Do something to point someObject at an object
NSLog(NSStringFromClass([someObject class])); // You can also ask for className directly
id is simply void *. If you meant what is the class of object currently being pointed to you can simply ask it:
Code:
id someObject;
// Do something to point someObject at an object
NSLog(NSStringFromClass([someObject class])); // You can also ask for className directly
This is ok for NSString and like wise Class type.
But what aboout NSInteger, NSUInteger, etc. basic types?
It is not working with NSInteger.
Any other way?
NSInteger etc are not objects and should not be assigned to id pointers. If you do so you run the risk of accessing them as objects. If you insist on storing them in this way there is no way of finding their type later.