我有一个.db的数据库 我copy到沙盒中之后用BOOL 判断copy成功 但是内容全不见了 ?
0KB???
NSFileManager *fieldManager=[NSFileManager defaultManager];
NSString *nfieldPath=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,YES)[0]stringByAppendingPathComponent:@"number_location.db"];
NSString *yfieldPath=[[NSBundle mainBundle] pathForResource:@"number_location" ofType:@"db"];
if(![fieldManager fileExistsAtPath:nfieldPath])
{
BOOL isCopy=[fieldManager copyItemAtPath:yfieldPath toPath:nfieldPath error:nil];
if(isCopy)
{
NSLog(@"复制成功");
}
}