Ios 已将无法识别的选择器发送到实例

Ios 已将无法识别的选择器发送到实例,ios,objective-c,unrecognized-selector,Ios,Objective C,Unrecognized Selector,因此,我在查看堆栈溢出时,看到许多无法识别的选择器发送到实例错误消息。一些与电弧相关,大多数与电弧无关。实际上,我正在做的是每6秒调用一个NSTimer来调用一个方法来更改照片数组的文件路径。(如果您愿意的话,这是一个自动横幅。)6秒过后,我收到以下错误消息: 2014-07-10 11:04:35.152 ysysy[435:57924] -[TableViewController animateFunction]: unrecognized selector sent to instance

因此,我在查看堆栈溢出时,看到许多无法识别的选择器发送到实例错误消息。一些与电弧相关,大多数与电弧无关。实际上,我正在做的是每6秒调用一个NSTimer来调用一个方法来更改照片数组的文件路径。(如果您愿意的话,这是一个自动横幅。)6秒过后,我收到以下错误消息:

2014-07-10 11:04:35.152 ysysy[435:57924] -[TableViewController animateFunction]: unrecognized selector sent to instance 0x156989f0
2014-07-10 11:04:35.154 ysysy[435:57924] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TableViewController animateFunction]: unrecognized selector sent to instance 0x156989f0'
我在ViewWLLapperMethod中调用setBannerTimer方法:

[self performSelectorOnMainThread:@selector(setBannerTimer) withObject:nil waitUntilDone:NO];
然后,setBannerTimer每6秒触发一个名为animate function的字符串方法:

- (void) setBannerTimer {


    self->bannerTimer = [NSTimer scheduledTimerWithTimeInterval:6 target:self selector:@selector(animateFunction) userInfo:nil repeats:YES];
    }
动画功能:

 +(NSString *)animateFunction

return photoPath;
}

希望我能把我的问题摆出来让每个人都容易理解。我的方法一定有语法错误,对吧?我是如此接近!提前谢谢

这与ARC无关,scheduledTimerWithTimeInterval:target:selector:userInfo:repeats应该有一个实例方法选择器,而不是类方法一个

=>呼叫

- (NSString *)animateFunction
而不是

+ (NSString *)animateFunction

呃,您已经声明了
animateFunction
作为类方法,但计时器函数需要一个实例方法。尝试使用
-(NSString*)animateFunction
而不是“+(NSString*)animateFunction”,您正在调用一个类方法。伙计,我真的认为您需要重新开始iOS开发。我看到到处都是糟糕的设计。@duci9y-hah!是的,我还在学这个行话。我同意你的看法,Java更像是我的母语。可能是