보통 내 일반적인 didselectrowatindexpath이처럼 명령없이 선택되지 않은 얻을. 그런 다음 행을 빠르게 선택 해제하십시오. 행을 선택 해제하지 않으면 이전에 선택된 행이 다시있을 때 나타납니다.셀은 선택 해제의
그러나 나는 내 과거의 코드에서 확인하면, 나는 행이 성공적으로 내가 언제 어디서 행을 선택 취소 추적 사방에 함정을 넣어 모든
에서 해제 호출하지 않은 경우에도 해제되는 것을 보았다 :
-(void)viewDidAppear:(BOOL)animated
{
...
PO(self.tableView.indexPathForSelectedRow); //always show null here
while(false);
}
는, viewDidAppear에 의해 밝혀 내가 세부에서 복귀 후 self.tablevView.indexPathForSelectedRow 이미 널 말한다. 행은 이미 선택 취소되었지만 언제 어디서?
나는 사람들의
-(void)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
while (false);//breakpoint here never called
}
-(void) tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *) indexPath
{
while (false); //breakpoint here never called
}
없음 이제까지라고하지 않습니다 명백한 장소에 대한 자세한 트랩을 넣어.
나는 포기했습니다. ,
지금 biggy하지 그러나 이것은 끝이
당신이 거기
UITableViewController
의 기본 동작입니다
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath];
if ([cell isKindOfClass:[BGUIBusinessCellForDisplay class]])
{
BGUIBusinessCellForDisplay * cellBiz = (BGUIBusinessCellForDisplay *) cell;
[BGDetailBusinessViewController detailButtonPressed:cellBiz.biz withNavController:self.navigationController];
}
else if ([cell isKindOfClass:[BGAddMoreBusiness class]])
{
BGBusinessEditViewController * editBusiness = [[BGBusinessEditViewController alloc]init];
[self.navigationController SafelyPushController:editBusiness];
}
PO(self.tableView.indexPathForSelectedRow); //not null here
}
UITableViewController가 아닌 UIViewController와 함께 tableView를 사용하고 있습니다. –
+1. 내가 무슨 일이 벌어지고 있는지 이미 알고있는 것 같아. –