Last active
August 29, 2015 14:21
-
-
Save Koze/2a86fa8ee3bb08f77433 to your computer and use it in GitHub Desktop.
instance method named "class"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class cls1 = [NSObject class]; | |
NSLog(@"%@", NSStringFromClass(cls1)); | |
// NSObject | |
NSObject *object = [[NSObject alloc] init]; | |
Class cls2 = object.class; | |
NSLog(@"%@", NSStringFromClass(cls2)); | |
// NSObject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let cls1: AnyClass = NSObject.self | |
NSLog("%@", NSStringFromClass(cls1)) | |
// NSObject | |
let object: NSObject = NSObject() | |
let cls2: AnyClass = object.dynamicType | |
NSLog("%@", NSStringFromClass(cls2)) | |
// NSObject |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment