0
我threeaing一些這樣的任務:iPhone:無法識別的選擇錯誤
RootViewController的
- (void)viewDidLoad {
[NSThread detachNewThreadSelector:@selector(findSomething) toTarget:self withObject:nil];
}
- (void) findSomething {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
doMoreThings
[pool release];
}
- (void) doMoreThings {
doMoreMoreMoreThings on different objects
}
- (void) foundSomething:(NSFoundThing*)foundObj {
do your stuff
}
oneObject
- (void) doMoreMoreMoreThings {
do things
[self performSelectorOnMainThread:@selector(foundSomething:) withObject:thingFound waitUntilDone:NO];
}
給
-[KMLParser foundSomething:]: unrecognized selector sent to instance 0x5888080
問題是什麼?
在顯示的代碼中發送了哪個對象是我的選擇器? – Oliver 2011-06-14 22:04:59
** oneObject **部分中的哪個對象是'self'。 – 2011-06-14 22:06:21
我會讀一些關於線程的更多內容,但只是一個問題:如果我在oneObject類中有一個foundSomething方法會發生什麼?在線程方面會發生什麼:我已經有了一個主要的thjread,其中有東西跑進去...... – Oliver 2011-06-14 22:10:04