简体   繁体   English

iPhone上的App Documents文件夹

[英]App Documents Folder on iPhone

I developed an app for iPhone. 我为iPhone开发了一个应用程序。 I'm using a sqlite database that is sited on Library/ApplicationSupport/iPhoneSimulator/4.3/MyApp/Documents. 我正在使用位于Library / ApplicationSupport / iPhoneSimulator / 4.3 / MyApp / Documents上的sqlite数据库。 Everything work fine on the Simulator. 在模拟器上一切正常。 Now i followed this guide (http://stackoverflow.com/questions/246422/how-can-i-deploy-an-iphone-application-from-xcode-to-a-real-iphone-device) to add my app on my iPhone. 现在我按照本指南(http://stackoverflow.com/questions/246422/how-can-i-deploy-an-iphone-application-from-xcode-to-a-real-iphone-device)添加我的应用在我的iPhone上。 The problem is that the App doesn't load data from the database, where have i to site my database on the iPhone? 问题在于该应用程序无法从数据库中加载数据,我应该在哪里将数据库放在iPhone上? Where is and how can i reach the right folder? 在哪里,如何找到正确的文件夹?

NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *sDocumentsDir = [documentPaths objectAtIndex:0];

this is the path to your documents folder 这是您的文档文件夹的路径

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM