UITabBarViewController & UINavigationController & UITableView
My app crashes when I try to push a detail view controller when selecting a cell.
If I empty the detail view controller I am trying to push, it works, but when I add UITextField
s and action buttons to the view, the app crashes.
Here is my code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger row = [indexPath row];
if(self.addSimpleTrainingVC == nil)
{
AddDetailVC *tempVC = [[AddDetailVC alloc] initWithNibName:@"addDetailVC" bundle:nil];
self.addDetailVC = tempVC;
[tempVC release];
}
addDetailVC.title = [NSString stringWithFormat:@"%@",[myArray objectAtIndex:row]];
[self.navigationController pushViewController:self.addDetailVC animated:YES];
addDetailVC.title = [NSString stringWithFormat:@"%@",[myArray objectAtIndex:row]];
// myAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
// [delegate.myNavBarController pushViewController:addDetailVC animated:YES];
// self.addDetailVC.view.hidden =NO;
// [delegate.myNavBarController pushViewController:addDetailVC animated:YES];
}