下面的代碼的行爲與預期但是編譯器不斷告訴我: 警告:「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