Question

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.

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top