2009-12-10 4 views
0

nouveau dans le coin de l'iPhone ... hii ..... j'ajoute une nouvelle cellule en mode d'édition .. et j'utilise reuseCell Identifier mais quand j'insère une nouvelle ligne le dernier rang contect chevauche nouvelle ligne ajoutée contenu .. plz me dire quel est le probUITableView reuseIdentifier

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 

NSString *MYIdentifier [email protected]"MyIdentifier"; 

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MYIdentifier]; 

if(cell==nil) 
{ 
    //cell=[[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MYIdentifier] autorelease]; 
    cell = [self reuseTableViewCellWithIdentifier:MYIdentifier indexPath:indexPath]; 
} 


if(indexPath.row == [appDelegate.frndArray count]) 
{ 

NSString *addNewFrndIndentifier = @"New Friend Indentifier"; 

UITableViewCell *frndCell = [tableView dequeueReusableCellWithIdentifier:addNewFrndIndentifier]; 

if(frndCell == nil) 
    { 
    frndCell=[[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:MYIdentifier] autorelease]; 
    } 
    [[frndCell textLabel]setText:@"Add new friend"]; 
} 
return cell; } 

-(UITableViewCell *)reuseTableViewCellWithIdentifier:(NSString *)identifier indexPath:(NSIndexPath *)indexPath{ 

/// some code to display the content added some UIImage and UILabel 
return cell 
} 

Répondre