标签:index turn bat 第三方 set 文件 odi utf-8 mic
NSString*path = [[NSBundlemainBundle]pathForResource:@"DB.sqlite"ofType:nil]; FMDatabase*db = [FMDatabasedatabaseWithPath:path]; if(![dbopen]) { NSLog(@"数据库打开失败"); return; }else{ NSLog(@"打开成功"); } FMResultSet*results = [dbexecuteQuery:@"SELECT * FROM BatteryUTF8"]; while ([results next]) { NSLog(@"%@ %@ %@ %@ %@ %@", [results objectForColumnIndex:0],[results objectForColumnIndex:1],[results objectForColumnIndex:2],[results objectForColumnIndex:3],[results objectForColumnIndex:4],[results objectForColumnIndex:5]); }
5、代码写入plist文件,然后从沙盒中拷贝出该文件
NSArray*doc =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); NSString*docPath = [ docobjectAtIndex:0]; [ arraywriteToFile:[docPathstringByAppendingPathComponent:@"Battery.plist"]atomically:YES]; NSLog(@"pathPlist:%@",docPath);
标签:index turn bat 第三方 set 文件 odi utf-8 mic
原文地址:https://www.cnblogs.com/ios-wmm/p/10216052.html