NSUserDefault からの多次元配列の格納とアクセスに少し問題があります。どんな助けでも大歓迎です。このコードを実行すると発生するエラーは、「*キャッチされない例外 'NSInternalInconsistencyException' が原因でアプリを終了しています。理由: '-[__NSCFArray insertObject:atIndex:]: mutating method sent to immutable object'」です。
//To create, add values to and store arrays
multiArray = [[NSArray alloc] init];
multiArray = [NSArray arrayWithObjects:[NSMutableArray array], [NSMutableArray array], [NSMutableArray array], nil];
[[multiArray objectAtIndex:0] addObject:[NSNumber numberWithDouble:number1]];
[[multiArray objectAtIndex:1] addObject:[NSNumber numberWithDouble:number2]];
[[multiArray objectAtIndex:2] addObject:[NSNumber numberWithDouble:number3]];
NSUserDefaults * standardUserDefaults = [NSUserDefaults standardUserDefaults]
[standardUserDefaults setObject:multiArray forKey:@"multiArray"];
[standardUserDefaults synchronize];
//To access the array
NSArray *multiArrayCopy = [[NSArray alloc] init];
multiArrayCopy = [[standardUserDefaults objectForKey:@"multiArray"] mutableCopy];
NSLog(@"array count is %i", [[multiArrayCopy objectAtIndex:2] count]);
Label1.text = [NSString stringWithFormat:@"%@", [[multiArrayCopy objectAtIndex:0] objectAtIndex:0]];
Label2.text = [NSString stringWithFormat:@"%@", [[multiArrayCopy objectAtIndex:1] objectAtIndex:0]];
Label3.text = [NSString stringWithFormat:@"%@", [[multiArrayCopy objectAtIndex:2] objectAtIndex:0]];