我已经看到 writeToFile 不适用于非对象的解释,但是,此片段显示在 iPad 设备上的工作原理和模拟器的工作原理之间存在严重差距。
NSMutableArray *arrayOne = [NSMutableArray arrayWithObjects:@"Thing One", @"Thing Two", @"Thing Three", nil];
[arrayOne writeToFile:@"myLocalMovieMetaData-v11" atomically:YES];
NSLog(@"cancelNowButton Test Metadata File Written.");
NSMutableArray *arrayTwo = [NSMutableArray arrayWithContentsOfFile:@"myLocalMovieMetaData-v11"];
NSLog(@"arrayOne: %@",arrayOne);
NSLog(@"arrayTwo: %@",arrayTwo); //this prints on simulator but not the device.