我的代码是:
- (IBAction) buttonPressed:(id)sender
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle: nil];
DestinationViewController *destinationViewController = [storyboard instantiateViewControllerWithIdentifier:@"Destination"];
destinationViewController.title = @"image property";
[self.navigationController pushViewController:destinationViewController animated:YES];
[destinationViewController release];
}
但我得到的错误是:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Storyboard (<UIStoryboard: 0x68a0840>) doesn't contain a view controller with identifier 'Destination''
First throw call stack:
(0x13d4022 0x1565cd6 0x448fef 0x39f6 0x13d5e99 0x2114e 0x210e6 0xc7ade 0xc7fa7 0xc7266 0x463c0 0x465e6 0x2cdc4 0x20634 0x12beef5 0x13a8195 0x130cff2 0x130b8da 0x130ad84 0x130ac9b 0x12bd7d8 0x12bd88a 0x1e626 0x2902 0x2875)
terminate called throwing an exception(lldb)
有什么想法吗?
提前致谢。