将工程中的文件写入到应用程序中得Documents文件下

来源:互联网 发布:情义知多少 编辑:程序博客网 时间:2024/06/23 13:53
NSString*dbSourceFile = [[NSBundlemainBundle]pathForResource:@"symptom_sqlite3"ofType:@"db"];
       
NSData * data = [NSDatadataWithContentsOfFile:dbSourceFile];
       
       
NSString * aimPath = [NSHomeDirectory()stringByAppendingPathComponent:@"Documents/symptom_sqlite3.db"];
       
       
BOOL success;
       
           
if (data) {
                success = [data
writeToFile:aimPathatomically:YES];
            }
0 0
原创粉丝点击