0
我已经看到writeToFile不能用于非对象的解释, 但是,这段代码显示iPad上的工作方式存在严重的缺陷设备 以及模拟器如何工作。objective-c 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.
这也正是问题。 (你打我几秒钟。)到OP,检查你的硬盘驱动器的根。你会发现在那里创建了“myLocalMovieMetaData-v11”文件。 – 2011-01-10 23:25:20