I got into a weird situation, I am trying different methods of NSObject just to know how it works. I am currently testing them on a simple view based application on iOS. I created a random object greater which returns objects in id as basic NSObject, Than I want to determine what object it is by getting their class name. Therefore I used below method…
Link Edited
Now when I call this method on my random object, Like…
[object className];
Xcode gives me an error saying this…
Instance method ‘-className’ not found
Is this method deprecated? Or Am I doing something wrong?
Thanks
For whatever reason, the
classNamemethod only exists on Mac OS X. On iOS you can useNSStringFromClass([object class])instead.