헤더 뷰에 UISearchbar가있는 UITableViewController가 있습니다. 사용자가 검색하면 내 UITableView가 결과로 채워집니다. 사용자가 결과를 선택할 때 새로운 뷰 컨트롤러를 스택에 푸시하고 싶습니다.UITableViewController가 뷰를 스택에 푸시하지 않습니다.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
if (cell.accessoryType == UITableViewCellAccessoryNone) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
WatchlistSheetView* watchlistSheetView = [[WatchlistSheetView alloc] initWithNibName:@"WatchlistSheetView" bundle:nil];
watchlistSheetView.symbol = cell.textLabel.text;
[self.navigationController pushViewController:watchlistSheetView animated:YES];
[watchlistSheetView release];
//[self dismissModalViewControllerAnimated:YES];
}
}
다음은보기 컨트롤러를 스택으로 푸시하지 않습니다. 아무 반응이 없습니다. 어떻게 해결할 수 있습니까?
이 호출 후에 watchlistSheetView가 nil이 아니며 self.navigationController가 nil이 아닌지 확인할 수 있습니까? 전반적으로이 코드는 잘 보입니다. –