首页 > 代码库 > [super class] 和 [self superclass] 区别

[super class] 和 [self superclass] 区别

#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad {    [super viewDidLoad];        NSLog(@"super class %@",[super class]);        NSLog(@"super class %@",[super class]);    }

  

2014-12-04 15:31:53.759 MoMo[1829:114392] super class --> ViewController

2014-12-04 15:31:53.760 MoMo[1829:114392] self superclass --> UIViewController

 

[super class]  : 指当前的类。

[self superclass] :指父类。

 

[super class] 和 [self superclass] 区别