i m new to iPhone corner... hii.....i am adding a new cell when in editing mode.. and using reuseCell Identifier but when i am inserting a new row the last row contect overlap the new row added content.. plz tell me what's the prob
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *MYIdentifier =@"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
}