简体   繁体   中英

iOS Not Pushing new view to NavigationController

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM