By using “editingStyleForRowAtIndexPath” method, “didSelectRowAtIndexPath” method is not called
the delegate method not called
-(void)viewWillAppear:(BOOL)animated
{
[theTableView setEditing:TRUE animated:TRUE];
}
-(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleDelete;
}
by calling the above the methods i will get minus component before each cell in table view.
But the below method didSelectRowAtIndexPath is not called and disclouser indicator is not in visible.
- (void )tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[theTableView deselectRowAtIndexPath:indexPath animated:YES];
ContactEditViewCotroller *contactEditViewCotroller=[[ContactEditViewCotroller alloc]init];
contactEditViewCotroller.isEdit=isEdit;
if(isEdit == YES)
{
for(int i=0; i<=[editObject.contactList count]-1;i++)
{
if(indexPath.section == i)
{
appDelegate.isAddInEdit=NO;
editcontacts = [editObject.contactList objectAtIndex:i];
contactEditViewCotroller.editcontacts=editcontacts;
indexRow=i;
}
}
}
else
{
for(int i=0开发者_运维问答; i<=[addContactList count]-1;i++)
{
if(indexPath.section == i)
{
appDelegate.isAddInEdit=NO;
Contacts *obj = [addContactList objectAtIndex:i];
contactEditViewCotroller.addcontacts=obj;
}
}
}
[[self navigationController] pushViewController:contactEditViewCotroller animated:YES];
[contactEditViewCotroller release];
}
Method didSelectRowAtIndexPath will be called when you set allowsSelectionDuringEditing to TRUE.
The value of allowsSelectionDuringEditing determines whether users can select cells while the receiver is in editing mode.
Set it like this:
tableView.allowsSelectionDuringEditing = YES;
精彩评论