0

I'm trying to pass an array from view A to segue B, here's the code:

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

I've declared BArray as property in BViewCOntroller:

  @property (retain) NSMutableArray *BArray;

and synthesized it....

and the error is

NSInvalidArgumentException', reason: '-[UINavigationController setBArray:]: unrecognized selector sent to instance...

where am i wrong? Thank you in advance,

4

1 回答 1

3

destinationViewController 返回的是 UINavigationController,而不是 BViewController。您是否正在使用新的 UINavigationController?可能是您的故事板中的错误。

于 2012-04-13T20:44:10.943 回答