@interface CardModel : NSObject
@property (nonatomic, copy) NSString *name;
-(void)print;
@end
@implementation CardModel
-(void)print
{
NSLog(@"result: %@", self.name);
}
@end
-(void)viewDidLoad() {
// NSObject *objc8 = [[NSObject alloc] init]; 解注释会打印这个对象
id cls = [CardModel class];
void *obj = &cls;
[( __bridge id)obj print];
}
以上打印结果是:
2018-09-21 02:59:04.711416+0800 WxPay[82898:5732920] result:<ViewController: 0x7fe525405e50>
网友评论