调用时:
NSDictionary *dict = [NSKeyedUnarchiver unarchiveObjectWithData:dictData];
Program received signal SIGSEGV, Segmentation fault.
0x400c6844 in strcmp ()
from /Users/myname/.apportable/cache/devices/4dfcdd3168ea50fb/libs/libc.so
是否存在适用库的错误?
测试代码:
NSDictionary *dictionary = [[NSDictionary alloc]initWithObjectsAndKeys:[NSValue valueWithRange:NSMakeRange(0,16)],@"Archive_Version",[NSValue valueWithRange:NSMakeRange(16,0)],@"Clothes.txt",nil];
NSData *dictData = [NSKeyedArchiver archivedDataWithRootObject:dictionary];
[dictionary release];
NSDictionary *dict2 = [NSKeyedUnarchiver unarchiveObjectWithData:dictData];
我使用 Apportable 的免费版本,当我在控制台中调试时,结果是:
(gdb) po 字典 {Archive_Version = "{location=0, length=16}"; Clothes.txt = "{location=16, length=0}"; }
(gdb) po dict2 {Archive_Version = "{location=-284, length=1588768934}"; Clothes.txt = "{location=7, length=1593147632}"; }
谢谢~