我正在尝试用数组中的一些数据填充表视图.数组已填充,但是当我运行应用程序时,我收到此错误:原因:' - [__ NSCFArray length]:无法识别的选择器发送到实例
我搜索了类似的问题,但没有人适合我.我不使用lenght函数,我的应用程序崩溃:cell.textLabel.text = [self.currentDate objectAtIndex:indexPath.row];
quizViewController.m
- (void)passDataForward
{
ScoreViewController *secondViewController = [[UIStoryboard storyboardWithName:@"Storyboard" bundle:[NSBundle mainBundle]]instantiateViewControllerWithIdentifier:@"score"];
secondViewController.data =self.scoreLabel.text;
secondViewController.delegate = self;
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];
[highScores insertObject:self.scoreLabel.text atIndex:highScores.count];
NSData *currentDate =[NSDate date];
NSDateFormatter *dateFormatter=[[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"dd.MM.YYYY HH:mm:ss"];
NSString *dateString =[dateFormatter stringFromDate:currentDate];
[data insertObject:dateString atIndex:data.count];
NSMutableArray *scorearray = [[NSMutableArray alloc] initWithArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"high_scoresarray"]];
NSMutableArray *dataArray = [[NSMutableArray alloc] initWithArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"data_score"]];
[scorearray addObject:highScores];
[dataArray addObject:data];
[[NSUserDefaults standardUserDefaults] setObject:scorearray forKey:@"high_scoresarray"];
[[NSUserDefaults standardUserDefaults] setObject:dataArray forKey:@"data_score"];
secondViewController.test=[NSMutableArray …Run Code Online (Sandbox Code Playgroud)