What is an arbitrary object?
Ask Question
Asked 13 years, 2 months ago
Modified 13 years, 2 months ago
Viewed 4k times
3
I've been researching google on what it is, but haven't been able to find an answer. You can look up google yourself if you want.
So, I've come here for help. Just wanted to know what that type of object is and what it does.
Thanks in advance...
objective-cxcode
Share
Follow
asked Nov 14, 2010 at 14:09
taevanbat's user avatar
taevanbat
42511 gold badge88 silver badges1717 bronze badges
Add a comment
Report this ad
2 Answers
Sorted by:
2
If you have an arbitrary object in Objective-C (typed id), you can inquire information about its class by calling the class selector:
Class c = [obj class];
You can log that to the console (NSLog(@"%@", [obj class])) or perform other operations to see which selectors are supported on the object, etc.
Share
Follow
answered Nov 14, 2010 at 14:14
Jason's user avatar
Jason
28.3k1010 gold badges6464 silver badges6464 bronze badges
Add a comment
1
It's any object that is derived from the language's ur-type (if it has one).
Share
Follow
answered Nov 14, 2010 at 14:10
Ignacio Vazquez-Abrams's user avatar
Ignacio Vazquez-Abrams
783k154154 gold badges13481348 silver badges13651365 bronze badges
Add a comment