Alessandro
Alessandro

Reputation: 4110

storing files on iCloud and distributing them to all app users

I am building a iOS 5.1 app using storyboard. this app contains a table view. My idea was to add an "add" button to my title bar, in the table view. When a user clicks on the add, a simple document editor I need to build (like keynote or pages) will open. when the user clicks on the save button, the file will be uploaded possibly on I cloud, and all other users of the application will be able to access it, from a downloads tab, download it, and add it to their own app (a sort of file sharing via iCloud). Is it possible to do something like that? How can I do it? Can I do it using iCloud, or do i need to build my own database?

Upvotes: 0

Views: 678

Answers (1)

Dmitry Zhukov
Dmitry Zhukov

Reputation: 1816

maybe you should try to use this:

NSURL *urlToShare = ...; NSDate *date;
NSError *error;
NSURL *sharedURL =
    [[NSFileManager defaultManager] URLForPublishingUbiquitousItemAtURL:urlToShare
                                                         expirationDate:&date
                                                                  error:&error];

Thats from CS193p lessons. This code will help you to share files between different iCloud Accounts.

But remember that "Only files (not directories) maybe exported in this way. The URL points to a copy of the file (so it is a read-only sharing mechanism)."

Hope this helps!

Upvotes: 1

Related Questions