下面的代码的行为与预期但是编译器不断告诉我: 警告:“StatusViewController”不能为“-beginLoadingThreadData”如何摆脱<Class>的警告可能不会响应<Selector>?
如何摆脱警告的也是最重要的,为什么Xcode中认为,应对是案子?
这里是我的代码:
[self beginLoadingThreadData]; // called in the loadDidView block
- (void)beginLoadingThreadData
{
[NSThread detachNewThreadSelector:@selector(loadThreadData) toTarget:self withObject:nil];
}
- (void)loadThreadData
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSThread sleepForTimeInterval:2];
[self performSelectorOnMainThread:@selector(finishedLoadingThreadData) withObject:nil waitUntilDone:NO];
[pool release];
}
- (void)finishedLoadingThreadData
{
[[BusinessLogic instance] startTracking:self];
}
我必须检查3次,我看到了声明......不止一个应用程序我需要一位眼科医生 - 谢谢彼得! – amok 2009-09-24 21:13:06