将数组传递给segue

时间:2012-04-13 19:58:11

标签: ios arrays segue

我正在尝试将视图A中的数组传递给segue B,这是代码:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([[segue identifier] isEqualToString:@"B"]) {
        BViewController *B = [segue destinationViewController];
        [B setBArray:self.AArray];
}

我已将BArray声明为BViewCOntroller中的属性:

  @property (retain) NSMutableArray *BArray;

合成它......

,错误是

NSInvalidArgumentException', reason: '-[UINavigationController setBArray:]: unrecognized selector sent to instance...
我错在哪里?提前谢谢你,

1 个答案:

答案 0 :(得分:3)

destinationViewController返回一个UINavigationController,而不是一个BViewController。您是否正在寻找新的UINavigationController?可能是你的故事板中的一个错误。

相关问题