摘要: 用C代替OC:#import#import#importexternintUIApplicationMain (intargc,char*argv[],void*principalClassName,void*delegateClassName);structRect {floatx;floaty;... 阅读全文
posted @ 2014-10-20 15:14 蜗牛强 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 11、系统类的方法实现部分替换- (void) methodExchange { Method m1 = class_getInstanceMethod([NSString class], @selector(lowercaseString)); Method m2 = class_getIn... 阅读全文
posted @ 2014-10-20 15:11 蜗牛强 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 6、获取一个类的所有方法:u_int count; Method * methods = class_copyMethodList([CustomClass class], &count); for (int i = 0; i < count; i++) { SEL name ... 阅读全文
posted @ 2014-10-20 14:41 蜗牛强 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 创建公共类:@interface CustomClass : NSObject- (void) fun1;@end@implementation CustomClass-(void)fun1{ NSLog(@"fun1");}@end@interface TestClass : NSObject@... 阅读全文
posted @ 2014-10-20 11:09 蜗牛强 阅读(169) 评论(0) 推荐(0) 编辑