下面的代码:目标C线程问题
for(int i = 0; i < personListViewController.peopleCount; i++) {
[NSThread detachNewThreadSelector:@selector(getPerson:) toTarget:self withObject:i];
}
getPerson看起来是这样的:
- (void)getPerson:(int)whichPerson { }
当我建立这个,我得到如下:警告:传递detachNewThreadSelector的”说法三: toTarget:withObject:'使指针从整数没有铸造
我想要做的就是通过一个int传递给getPerson通过detachNewThrea dSelector和我无法弄清楚如何让它采取任何东西,但对象指针。我在这里错过了什么?
这样做。谢谢你一百万次。在objective-c中,我经常会遇到那些小事情。 – lewsid 2009-07-22 17:14:01