문제

I am working on an app that has a TabView controller, and in each tab is a TabeView, I have the TableView delegate and dataSource set to the main ViewController of the Object. I use the following code to try and push a new ViewController to the NavigationController:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    DonationsDataViewController *data = [self.storyboard instantiateViewControllerWithIdentifier:@"donationData"];
    //TODO set data to be passed;
    [self.navigationController pushViewController:data animated:YES];
    NSLog(@"Show donation details.");
}

The problem I am having is that the app does not crash, I get my Log of: Show Donation details., but it never pushed the ViewController, am I doing something wrong here? If so, what would be the appropriate path to take to fix the problem?

EDIT

See THIS for more information on the structure of the project. I am new to iOS and this is just a project to play around with and learn. The zipped project can be downloaded HERE.

도움이 되었습니까?

해결책

Have you verified that the navigationController instance is not nil? Sending messages to instances that are nil is valid in Objective-C, unlike in C#/Java, where calling methods on instances that are null will throw an exception.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top