【发布时间】:2016-02-16 00:44:55
【问题描述】:
我正在使用 SplitViewController 制作应用程序。
当我在 iPhone 6 Plus 上以横向模式使用我的应用程序时(拆分视图,就像在设置应用程序中一样),我得到了(这是正常的):
但是当我单击一个单元格以使用相应的图像更新详细视图时,我得到了一些奇怪的东西: 另一个详细视图从屏幕左侧弹出。它应该用新图像更新现有的详细视图。
您知道为什么会发生这种情况以及如何获得正确的行为吗?也许我在故事板中做错了什么?
[编辑]:
这是我的 prepareForSegue :
MY_Img *img = [self.imgs
objectAtIndex:self.tableView.indexPathForSelectedRow.row];
/*
DetailViewController *detailController = (DetailViewController *)segue.destinationViewController;
[detailController setDetailItem:img];
*/
((AppDelegate*)[UIApplication sharedApplication].delegate).detailItem=img;
我不得不使用它,因为注释部分会使程序崩溃。我不知道为什么。你知道那是错的吗?
他们,我用那个返回 DetailController 中的 img:
- (void)viewDidLoad {
[super viewDidLoad];
[self setDetailItem: ((AppDelegate*)[UIApplication sharedApplication].delegate).detailItem];
}
【问题讨论】:
-
这是我的故事板:screen1
标签: ios objective-c iphone cocoa iphone-6-plus