首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

数据库有有关问题了

2012-01-29 
数据库有问题了!把sqlite数据库加到程序里面在mac上面运行的时候可以成功复制到Document目录下,但是我联机

数据库有问题了!
把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]) 判断了?

热点排行