我正在尝试NSData
从文件路径中读取,并最终取消归档数据。
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docs = [paths objectAtIndex:0];
[[NSFileManager defaultManager] createDirectoryAtPath:[docs stringByAppendingString:@"/dynSplash"]
withIntermediateDirectories:NO
attributes:nil
error:nil];
NSString *dynamicSplashFile = [docs stringByAppendingString:@"/dynSplash/dynamicSplash.data"];
DynamicSplash *splash;
if([[NSFileManager defaultManager] fileExistsAtPath:dynamicSplashFile]) {
NSLog(@"Dynamic splash exists");
NSData *data = [NSData dataWithContentsOfFile:dynamicSplashFile];
splash = [NSKeyedUnarchiver unarchiveObjectWithData:data];
}
问题出现在引发错误的行[NSData dataWithContentsOfFile:dynamicSplashFile]
上。EXC_BAD_ACCESS
我该如何调试呢?