我正在使用NSArray
DetailViewController 中的数据显示。现在我已将其更改为 a ,当我推送到 DetailViewControllerNSMutableArray
时它会崩溃。viewWillAppear
什么会导致这种情况?
从 viewController 发送到 DetailViewController:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"DetailSegue"]) {
NSIndexPath *selectedRowIndex = [self.tableView indexPathForSelectedRow];
WinesDetailViewController *winesdetailViewController = [segue destinationViewController];
winesdetailViewController.detailsDataSource = [[NSMutableArray alloc] initWithObjects:sortedWines,nil];
winesdetailViewController.detailIndex = selectedRowIndex.row;
}
}
收到:
@property (strong, nonatomic) NSMutableArray *detailsDataSource;
@property int detailIndex;
视图将出现:
if ([[[detailsDataSource objectAtIndex: detailIndex] valueForKey:@"Rate"] isEqual:[NSNumber numberWithInt:1]]) {
ratingImageView.image = [UIImage imageNamed:@"ratingButtonOne@2x.png"];
}
flagImageView.image = [UIImage imageNamed:[[detailsDataSource objectAtIndex: detailIndex] valueForKey:@"Flag"]];
这是日志中显示的部分内容:
-[__NSArrayI isEqualToString:]: unrecognized selector sent to instance 0x6d2ee20
2012-08-15 00:00:16.860 Rødvinsguiden test[4240:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI isEqualToString:]: unrecognized selector sent to instance 0x6d2ee20'