【发布时间】:2014-09-14 06:41:10
【问题描述】:
我正在编写一个使用 Parse 服务的 iOS 应用程序。当我点击一个单元格时,它并没有像我预期的那样继续。看来我的“prepareForSegue”方法没有被调用。我使用断点来确定这一点,并且 NSLog 从不输出任何内容。这是我的方法:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
NSLog(segue.identifier);
if ([segue.identifier isEqualToString:@"showObjectDetails"]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
//OfferDetailViewController *destViewController = segue.destinationViewController;
PFObject *object = [self.objects objectAtIndex:indexPath.row];
[segue.destinationViewController setObject:object];
}
}
如果重要的话,segue 名称是“showObjectDetails”,它来自列表视图。我使用了 Push selection segue。我已确保在 Interface Builder 中正确设置了自定义类。我正在使用一个 Tab Bar 控制器,它引用一个 NavigationController,然后显示 tableview。
【问题讨论】:
-
你是如何在 Storyboard 中连接你的 segue 的?
标签: ios objective-c iphone parse-platform