下面的代碼:目標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