数据库有问题了!
把sqlite数据库加到程序里面在mac上面运行的时候可以成功复制到Document目录下,但是我联机到iphone上去的时候就是没有复制,有遇到这种问题的么?能帮忙解决下么?//NSString *localDBPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"Golf.sqlite3"];
//if (![[NSFileManager defaultManager] fileExistsAtPath:localDBPath]) {
//NSString *bundleDBPath = [[NSBundle mainBundle] pathForResource:@"Golf" ofType:@"sqlite3"];
//[[NSFileManager defaultManager] copyItemAtPath:bundleDBPath toPath:localDBPath error:nil];
//}
[解决办法]
其实我想知道你怎么测试说没有复制成功的?
你再次用if (![[NSFileManager defaultManager] fileExistsAtPath:localDBPath]) 判断了?