【发布时间】:2013-05-08 17:38:14
【问题描述】:
我已经使用 故事板
实现了我的 iphone 应用程序在我的应用程序中 *我需要将一个视图从一个视图呈现到另一个视图而不是脓*h,
我在故事板 xib 中为第二个视图创建了一个屏幕。
我 set up the connection for button in the first view to the second view with 'present' 不是。
现在i need to populate an array to the second view which was presented
我尝试了以下方法但没有成功
1:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(UIButton *)sender
{
//Populate detail to BuyView mail page
if ([segue.id
entifier isEqualToString:@"BuyView"])
{
BuyViewController *destViewController = segue.destinationViewController;
destViewController.itemDetailsArray = [_itemDetailsArray objectAtIndex:sender.tag] ;
}
}
2:
- (IBAction)buyItemClick:(UIButton *)sender
{
BuyViewController *destViewController = [[BuyViewController alloc] init];
destViewController.itemDetailsArray = [_itemDetailsArray objectAtIndex:sender.tag] ;
}
【问题讨论】:
-
什么“后路”?另外,“我已经为第二个视图创建了一个故事板 xib”没有意义——你的意思是你在故事板中为你的第二个视图控制器创建了一个场景?
-
找到解决方案了吗?
标签: iphone objective-c storyboard presentmodalviewcontroller