我正在做一些像这样的任务:
- (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
}
- (void) doMoreMoreMoreThings {
do things
[self performSelectorOnMainThread:@selector(foundSomething:) withObject:thingFound waitUntilDone:NO];
}
-[KMLParser foundSomething:]: unrecognized selector sent to instance 0x5888080
有什么问题?
答案 0 :(得分:1)
线程无关紧要。您没有向我们展示的一些代码是这样做的,因此您将foundSomething:
选择器发送到不处理该消息的对象。将消息路由到一个处理它的对象,你的问题就会消失。