Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
C# to Objective C by example #2
// Checking types
-int main(int argc, const char *argv[] )
{
// There's a lot more examples in the 3rd link at the bottom
MyObject *myobj = [[MyObject alloc] init];
MyObject *myobj2 = [[MyObject alloc] init];
if ([myobj class] == [myobj2 class])
NSLog("The same types");
// Also available are isMemberofClass and various respondsTo options.
if ([myobj isKindOfClass: [MyObject class])
NSLog("myobj is a MyObject");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.