root_methods.m
来自「linux下编程用 编译软件」· M 代码 · 共 48 行
M
48 行
/* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */#include <objc/objc.h>#include "next_mapping.h"/* Test that instance methods of root classes are available as class methods to other classes as well */@interface RootClass{ Class isa;}- (id) self;@end@implementation RootClass- (id) self{ return self;}#ifdef __NEXT_RUNTIME__ + initialize { return self; }#endif@end@interface NormalClass : RootClass@end@implementation NormalClass : RootClass@endint main (void){ Class normal = objc_get_class ("NormalClass"); if (normal == Nil) { abort (); } if ([NormalClass self] != normal) { abort (); } return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?