我有以下对象的数组:
@interface SACameraLocation : NSObject
{
NSInteger locId;
NSString *name;
CLLocationCoordinate2D coordinate;
NSInteger speed;
NSInteger shootingMode;
NSInteger side;
}
然后我试图将数组写入 plist 文件:
if([arr writeToFile:path atomically:YES])
NSLog(@"Write OK");
else
NSLog(@"Write Fail");
我猜这是由于标量对象而失败的。将此类对象序列化/反序列化到文件的最简单方法是什么?