这是我的代码:
- (IBAction) buttonPressed:(id)sender
{
DestinationViewController *destinationViewController = [[self.storyboard instantiateViewControllerWithIdentifier:@"Destination"] autorelease];
destinationViewController.title = @"image property";
destinationViewController.img = [UIImage imageNamed:@"thumbnail"];
[self.navigationController pushViewController:destinationViewController animated:YES];
[destinationViewController release];
}
输出是:
2012-07-20 10:43:29.976 jsonimage2[682:f803] 5 - fifth activity -http://i1184.photobucket.com/albums/z328/iElmoTutorials/CrazyEye.png
2012-07-20 10:43:31.878 jsonimage2[682:f803] The button's image is <UIImage: 0x6aa16c0>.
2012-07-20 10:43:33.846 jsonimage2[682:f803] it works
2012-07-20 10:43:33.861 jsonimage2[682:f803] -[ViewController setImg:]: unrecognized selector sent to instance 0x68a8b80