标签:style blog color 使用 sp for strong 数据 on
A.概念
1 // 1.直接调用 2 [p test2]; 3 // 2.使用@selector 4 [p performSelector:@selector(test2)]; 5 // 3.使用@selector调用带参数的方法 6 [p performSelector:@selector(test3:) withObject:@"李四"]; 7 8 SEL s = @selector(test3:); 9 [p performSelector:s withObject:@"李四”]; 10 11 SEL s2 = NSSelectorFromString(@"test3:"); 12 [p performSelector:s2 withObject:@"王五"];
1 - (void) test2 2 { 3 NSString *str = NSStringFromSelector(_cmd); 4 NSLog(@"%@", str); 5 NSLog(@"调用了%@", str); 6 }
[Objective-c 基础 - 2.11] SEL数据类型
标签:style blog color 使用 sp for strong 数据 on
原文地址:http://www.cnblogs.com/hellovoidworld/p/4119369.html