I am developing an iPhone app were I want to create a folder from my application on iCloud.
Is it possible to create folder on iCloud programmatically at all?
I want to add image files, text files and audio files in that folder.
Thanks.
Sure you can create folders. When you call [fileManager URLForUbiquityContainerIdentifier:] you get back a file URL for your container and you can put any file hierarchy in there you please.
Sounds like you're just getting started so I suggest you start with Apple's iCloud for Developers Documentation and Videos. Specifically you will want the Advanced iCloud Document Storage video as you'll want more control than CoreData and UIDocument will provide. Apple refers to this this type of iCloud storage as a "Shoebox App".
Related
I created an ebook app and my app contains a lot of images and pdf files
I was putting the downloaded images in /Library/Caches and putting the pdf files and .sqlite3 file in /Documents
now my app is rejected and this is the reason
2.23 Apps must follow the iOS Data Storage Guidelines or they will be rejected
Is this means that I have to move all what in /Documents to /Library/Caches?
If I let the .sqlite3 file in /Documents, will the app reject again?
Thanks in advance.
2.23 means that you should only put stuff into /Documents that cannot be re-downloaded from the internet. i.e. user-generated files. Everything that CAN be re-downloaded should be in Library/Caches.
The reason for this rule is that /Documents gets backed up and users don't like if you waste their precious iClould backup space.
You don't necessarily have to put the downloaded PDFs and databases into the Caches directory. An alternative would be to use the "do not backup" attribute, as described here: Technical Q&A QA1719 - How do I prevent files from being backed up to iCloud and iTunes?.
I was wondering whether my app's sqlite database will be transfer over to desktop when user sync the app with iTunes or do I need to do some coding to ensure that it will be transferred?
Please advice. Many thanks.
You can transfer the content of your document directory's document folder contents by adding UIFileSharingEnabled key to your info.plist.
Please check the below image:
After adding this key to your info.plist, when you sync your iPad with iTunes the documents inside the document folder will be listed in iTunes as shown below:
This is a nice tutorial for starting the iTunes filesharing: How to integrate iTunes file sharing
We not only can backup our files on itunes but also in icloud....
this is how the app data is persisted along the the app updation ,ios upgradation....
As you long you put your data files in standard locations within the app's sandbox and you don't explicitly flag the file as a file that shouldn't be backed up, then the data files will be backed up to iCloud or iTunes (depending on how the user has setup device backups).
It depends on your file scheme, you can decide which information is necessary and should be backed up and which one should not because it can be easily recreated.
Look for the "Where You Should Put Your App’s Files" section
http://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/FileSystemProgrammingGUide/FileSystemOverview/FileSystemOverview.html#//apple_ref/doc/uid/TP40010672-CH2-SW2
I want to transfer file from system (mac/Pc), which is present on my iPhone wifi network, to the document folder of my iPhone App.The scenario of my App is this, it will browse the system which are present in it's network. select any file(such as .pdf or ,docx) from that system(mac/Pc), copy it into the document folder of the APP and than use it with in the APP.During my search i come across the link iPhone : Transfer of files from Mac/Pc to app i have not found the detail instruction document, how to use it. Is Apple support any API or farm work to do this ? Please guide me
This is called iTunes file sharing. In the most simple way, you simply set the UIFileSharingEnabled key in your Info.plist file to YES. See for example this tutorial.
Rewriting itunes is not a simple task but I recommend you a clever and easier solution:
Implement a simple webserver on your iOS app. Write a windows application which will connect to your iOS app through wifi network. Then transfer the necessary files this way: you will send a file to you app, then your app should save it in documents directory.
It doesn't sound like this is possible, but I will ask anyway.
In my app, I store a lot of images and plists in the documents directory.
I would like to implement a PDF reader in the app that allows users to load their PDFs into the app via iTunes. I do not want the user to be able to see/access the contents of the documents directory since they could cause the app to perform unexpectedly if they messed with these files.
Is this possible, or is it possible to place my plists and images somewhere else?
You'll need to be registered with Apple to see this, but this page should give you the information you need.
You'll need to add a UIFileSharingEnabled key to Info.plist. This will give the user access to the Documents directory of the app, and let them remove or add files.
This tutorial gives an example of how to set up PDF support in an iPad app.
I need a copy of the store that is saved as Core Data sqlite file inside a test app installed on my device.
I know how to get files out of the the simulator at path: ~/Library/Application Support/iPhone Simulator/[Version]/Applications/[AppID]/Documents
...but i need get the .sqlite file from the app on the device itself.
Unless the app itself has file sharing built in, you can't access the documents folder from outside the app. It is a security precaution and part of the sandbox.
Update:
I misunderstood the context of the question. To get files off a developers iPhone, connect the device and open Xcode>Window>Organizer. Select the device in the lefthand pane. In the righthand pane will be a list of applications. Your custom apps will have an arrow next to it. Hit the arrow and you will see "Application Data" hit the down arrow icon and it will let you download the data to folder. That folder will contain the apps Document, Library and tmp folders.
I wrote an application specifically for this to distribute to my customers and testers of my applications when they have problems. iPhoneRescue is free and allows you to get at all of the backup information in your iPhone; this includes any sqlite files.
All the users have to do is find their device backup, find the application, and then save the application files or just a specific file. (This does not work if they have encrypted their backups).