0
我設置了。當顯示最後一個單元格時,通過threadProcess添加單元格。當最後一個單元格顯示時添加表格單元格。在ios
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
int nArrayCount;
nArrayCount=[self.mAppGameList count];
int row= (int)indexPath.row ;
if(row == nArrayCount)
{
if(mSearchGame_Thread != nil)
return;
NextSearchCell *searchCell =(NextSearchCell *)cell;
[searchCell.mActivityView startAnimating];
NSThread *searchThread = [[NSThread alloc] initWithTarget:self
selector:@selector(searchNextThreadProc:) object:tableView];
self.mSearchGame_Thread = searchThread;
[searchThread release];
[self.mSearchGame_Thread start];
// start new search ...
}
//線程方法
-(void)searchNextThreadProc:(id)param
{
UITableView *tableView=(id)param;
NSMutableArray *newArray;
newArray=[NSMutableArray arrayWithArray:self.mAppGameList];
NSArray *pressedlist;
nArrayCount=[self.mAppGameList count];
.
.
.
[newArray addObject:item];
self.mAppGameList = newArray;
[tableView reloadData];
self.mSearchGame_Thread=nil;
}
這樣的問題。
如果我在tableview重新載入數據時滾動表格,一段時間tableview消失並出現。
如果我在添加下一個單元格的同時觸摸單元格,有時它會發生錯誤的內存。 我想,它重新加載新表之前調用tableView:didSelectRowAtIndexPath:方法。所以,表格的數據不是。
所以,我想替換重載tableview的方式。有沒有什麼辦法?請幫幫我。