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