views:

14

answers:

0

I am really not sure why this is happening because I have similar logic all over my program but for some reason the following code seems to be where my app is crashing

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

 NSInteger row = [indexPath row];
 LessonRunViewController *lessonRunView = [[LessonRunViewController alloc] initWithNibName:@"LessonRunView" bundle:nil];

 lessonRunView.programString = self.programString;
 lessonRunView.weekLessonString = [self.dataToDisplay objectAtIndex:row];
 lessonRunView.hidesBottomBarWhenPushed = YES;
 [self.navigationController pushViewController:lessonRunView animated:YES];
 [lessonRunView release];
}

If I comment out the [lessonRunView release] line everything works fine but obviously there is then a memory leak which is not good. The lessonRunView release statement definitely works properly because when it is uncommented the view pushes to the Navigation Controller stack no problem. The app crashes after the resulting lessonRunView controller is popped from the controller stack, which is what I don't understand.

Please help this is the last bug in my app before I submit it I am really looking forward to getting past this.