我正在使用 Storyboard 和 xcode 5。
我正在尝试使用 NSUserDefaults 来存储图像数据。但我有很多图像
我认为这将很快耗尽。
有没有更好的方法将图像数据传递到另一个屏幕?
最佳答案
在目标 View Controller 中声明一个属性,如下所示 @property (nonatomic, strong) NSArray *places;在 Storyboard 中为您的序列设置身份名称
然后在方法中的源 Controller 中
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if([segue.identifier isEqualToString:@"SegueName"])
{
YourDestinationVC *vc = (YourDestinationVC *)segue.destinationViewController;
vc.places = places;
}
}
关于ios - 如何使用 Storyboard 将图像传递给另一个 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21508211/