本帖最后由 康佳兴 于 2014-6-17 14:15 编辑
#import <Foundation/Foundation.h> @interface Person : NSObject @end
@interface Student : Person @end
@interface GoodStudent : Student @end
int main() { Student *s = [[Student alloc] init]; return 0; }
@implementation Student + (void)load { NSLog(@"Student+load"); } + (void)initialize { NSLog(@"Student+initialize"); } @end
@implementation GoodStudent(MJ) + (void)load { NSLog(@"GoodStudent-MJ+load"); } + (void)initialize { NSLog(@"GoodStudent-MJ+initialize"); } @end
@implementation GoodStudent + (void)load { NSLog(@"GoodStudent+load"); } + (void)initialize { NSLog(@"GoodStudent+initialize"); } @end
@implementation Person + (void)load { NSLog(@"Person+load"); } + (void)initialize { NSLog(@"Person+initialize"); } @end
|