当前位置: 代码迷 >> Iphone >> 数据库有有关问题了
  详细解决方案

数据库有有关问题了

热度:135   发布时间:2016-04-25 06:49:47.0
数据库有问题了!
把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]) 判断了?
  相关解决方案