项目:OrderDishes_Tch
1.编写iPad程序的几项设置
2.数据库文件移动
从app下移动到documents下,再进行操作
文件:Appdelegate.m
- (void)copyDbToSandBox
{
//获取资源文件(app文件夹)的路径
NSString *sourcePath = [[NSBundle mainBundle]pathForResource:@"database" ofType:@"sqlite"];
NSString *destinationPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/database.sqlite"];
NSFileManager *manager = [NSFileManager defaultManager];
if ([manager fileExistsAtPath:destinationPath] == NO)
{
[manager copyItemAtPath:sourcePath toPath:destinationPath error:nil];
}
}