1

我有一个自定义 UITableViewController 显示一个带有位置列表的 TableView,我在情节提要(ios 5)中创建了一个 segue 并给了它一个标识符“SelectPlace”,它来自第一个 UITableViewController 中的一个单元格,应该继续下一个 UITableViewController 显示一个新的 tableview,其中包含所选位置的详细信息列表。

问题是 segue 没有执行(下一个 TableViewController 没有被推入屏幕,当前一个保持打开)即使我仔细检查了正确的标识符并将所有内容都设置到位。我什至看到(断点) -prepareForSegue 发生并成功完成。

我也尝试添加

[self performSegueWithIdentifier:@"SelectPlace" sender:[self.tableView cellForRowAtIndexPath:indexPath]];

到单元格选择

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

但这并没有帮助(而且我不认为这是必要的,因为情节是在情节提要上绘制的)

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    NSLog([segue.identifier description]);
    if ([segue.identifier isEqualToString:@"SelectPlace"])
    {
        NSArray* placePhotosArr = [FlickrFetcher photosInPlace:[self.topPlacesArray objectAtIndex:([self.tableView indexPathForCell:sender].row)] maxResults:50];
        [segue.destinationViewController setPlacePhotosArray:placePhotosArr];

        //[segue perform];
        NSLog([placePhotosArr description]);        

    }
}

少了什么东西???请帮忙

4

2 回答 2

0

我不知道这是否会有所作为,但我使用这个实现:

[[segue identifier] isEqualToString:@"YOUR_SEGUE_NAME_HERE"]

是推动还是您使用的是什么类型的过渡

于 2012-01-06T03:59:12.627 回答
0

我的错,segue 没有推动的原因是因为我忘记在导航视图控制器中“嵌入”tableviewcontroller ...... duh

于 2012-01-10T01:03:25.773 回答