如何归档 NSValues 数组?我应该进行哪些转换才能做到这一点?它不会按原样存档。
代码:
[[NSUserDefaults standardUserDefaults] setObject:[NSKeyedArchiver
archivedDataWithRootObject:[[NSArray alloc] initWithArray:drawingsArray]]
forKey:@"NSValuesArray"];
错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSKeyedArchiver encodeValueOfObjCType:at:]: this archiver cannot encode structs'
数组数据:
drawingsArray (
(
NSPoint: {439, 280},
NSPoint: {439, 280},
NSPoint: {439, 287},
NSPoint: {438.62, 290.104},
NSPoint: {439, 293}
)
)