2011-03-28 33 views
0

我的問題是錯誤的第一項。它不像其他人。一些代碼創建我的表。當我向下滾動並向上滾動第一項變得像其他項目,但是當我開始加載我的視圖時,它是不好的。爲什麼我的第一個項目看起來不對? (見圖)

- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    [tableView setEditing:YES]; 
    NSString *MyIdentifier = @"MyIdentifier"; 
    UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:MyIdentifier]; 

    if (cell == nil) 
    { 
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease]; 
    } 

    [cell.textLabel setText: [m_pArrayData objectAtIndex:indexPath.row]]; 
    return cell; 
} 

enter image description here

回答

0
[tableView setEditing:YES]; 

不應該在這裏完成。在viewWillAppear中執行它,或者更好地,用按鈕切換它。

+0

非常感謝!!!!!!! – Sveta 2011-03-28 07:08:14

相關問題