标题: 使用performSelector时有如下警告,求解决。 [打印本页] 作者: JiangHG 时间: 2015-3-18 17:28 标题: 使用performSelector时有如下警告,求解决。 代码如下:
Person 类中有如下方法:
@implementation Person
- (void)test2
{
NSLog(@"test2 ---");
}
@end
main函数函数如下:
int main()
{
SEL s2 = NSSelectorFromString(name);
[p performSelector:s2]; //此行警告“performSelector may cause a leak because its selector is unknown”警告