iOS 应用程序的沙盒 - Application’s Sandbox
2011-09-15 18:12
351 查看
以下是iOS模拟器下,文件的组织形式,在iOS Device 上的文件组织形式也是这样的。
iOS 将第三方程序储存在 Applications 文件夹下,各个程序的所有文件都在其 globally unique identifiers (GUIDs) 的文件下,GUID 文件夹即是程序的沙盒。
Documents: Your application stores its data in Documents, with the exception of NSUserDefaults-based preference settings.
Library: NSUserDefaults-based preference settings are stored in the Library/Preferences folder.
tmp: The tmp directory offers a place where your application can store temporary files. Files written into /tmp will not be backed up by iTunes when your iOS device syncs, but your application does need to take responsibility for deleting the files in /tmp once they are no longer needed, to avoid filling up the file system.
Getting the Documents Directory
Here’s some code to retrieve the path to the Documents directory:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
Getting the tmp Directory
NSString *tempPath = NSTemporaryDirectory();
注:
大部分内容摘自《Beginning iPhone 4 Development Exploring the iOS SDK》
iOS 将第三方程序储存在 Applications 文件夹下,各个程序的所有文件都在其 globally unique identifiers (GUIDs) 的文件下,GUID 文件夹即是程序的沙盒。
Documents: Your application stores its data in Documents, with the exception of NSUserDefaults-based preference settings.
Library: NSUserDefaults-based preference settings are stored in the Library/Preferences folder.
tmp: The tmp directory offers a place where your application can store temporary files. Files written into /tmp will not be backed up by iTunes when your iOS device syncs, but your application does need to take responsibility for deleting the files in /tmp once they are no longer needed, to avoid filling up the file system.
Getting the Documents Directory
Here’s some code to retrieve the path to the Documents directory:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
Getting the tmp Directory
NSString *tempPath = NSTemporaryDirectory();
注:
大部分内容摘自《Beginning iPhone 4 Development Exploring the iOS SDK》
相关文章推荐
- 详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!【2012-12-11日更新获取"产品付费数量等于0的问题"】
- 详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!【2012-12-11日更新获取”产品付费数量等于0的问题”】
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!
- <转>iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!
- 详解iOS应用程序沙盒(SandBox)测试、创建测试账号流程(
- 详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!2012-6-25日更新iap恢复
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!【2012-12-11日更新获取"产品付费数量等于0的问题"】
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!2012-6-25日更新iap恢复
- 详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!【2012-12-11日更新获取"产品付费数量等于0的问题"】
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!
- 详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!【2012-12-11日更新获取"产品付费数量等于0的问题"】
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!【2012-12-11日更新获取"产品付费数量等于0的问题"】
- 【iOS开发必收藏】详解iOS应用程序内使用IAP/StoreKit付费、沙盒(SandBox)测试、创建测试账号流程!