是否可以从选择器调用对象的实例方法?以下可能吗?它给我编译错误“:”缺少或者是什么:
timer = [NSTimer scheduledTimerWithTimeInterval:1.0
target:self
selector:@selector(([self.person dance]))
userInfo:nil
repeats:YES];
答案 0 :(得分:2)
将目标更改为self.person并使用舞蹈选择器:
timer = [NSTimer scheduledTimerWithTimeInterval:1.0
target:self.person
selector:@selector(dance)
userInfo:nil
repeats:YES];
答案 1 :(得分:0)
您是否尝试过更改目标?像这样:
timer = [NSTimer scheduledTimerWithTimeInterval:1.0
target:self.person
selector:@selector(dance)
userInfo:nil
repeats:YES];