2012-03-15 13 views
1

私はUITableViewControllerUITableViewCellです。このセルには3つのテキストフィールドがあります。各テキストフィールドにはタグがあります。セルは次のように作成されます。カスタムUITableViewCellはUITableViewで再利用されませんか?

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *CellIdentifier = @"reuseMyCell"; 

    cell = (TimeInserTableViewCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) { 

     NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TimeInsertCell" owner:self options:nil]; 

     for (id currentObject in topLevelObjects){ 

      if ([currentObject isKindOfClass:[TimeInserTableViewCell class]]){ 
       cell = (TimeInserTableViewCell *) currentObject; 
       if ([cell.reuseIdentifier isEqualToString: CellIdentifier]) { 

        break; 
       } 

      } 
     } 
    }   

    cell.taskNameField.delegate=self; 
    cell.startTime.delegate=self; 
    cell.endTime.delegate=self;   

    return cell; 
} 

私の問題は以下の通りです:私は、最初のテキストフィールドにテキストを入力し、私は、以前のテキストフィールドのテキストがあまりにも他のセルに交換されたときにスクロールします。

答えて

2

カスタムセルIBで再使用識別子を使用している天気を確認します。

関連する問題