Home > DeveloperSection > Interviews > Define Class Introspection

Posted on    September-19-2015 12:24 AM

 iPhone iPhone  Ios  Objective C 
Ratings:
 1 Answer(s)
  477  View(s)
Rate this:

Tarun Kumar

Total Post:107

Points:535
Posted on    September-19-2015 12:24 AM

-          Determine whether an objective-C object is an instance of a class:

         [obj isMemberOfClass:ColorClass];

-          Determine whether an objective-C object is an instance of a class or its descendants:

         [obj isKindOfClass:ColorClass];

-          The version of a class:

         [ColorString version]

-          Find the class of an Objective-C object:

         Class myClass1 = [obj1 class];

         Class myClass1 = [NSString class];

-          Verify 2 Objective-C objects are of the same class:

         [obj1 myClass2] == [obj2 class]


Don't want to miss updates? Please click the below button!

Follow MindStick