Search code examples
iphoneicloudphoto-gallery

How can I store image to iCloud from my iphone application?


I got a project like MyPhoto Pro app in iPhone App Store (website).

Please, can any one help or guide me what are the technologies and frameworks i should use for developing?

But my primary things is that image should stored in iCloud.


Solution

  • For iCloud file storage see Designing for Documents in iCloud in docs.

    Then check NSFileManager class, section Managing ICloud-Based Items.

    • -ubiquityIdentityTokendetect iCloud availability
    • -URLForUbiquityContainerIdentifier:obtain URL for iCloud directory (container)
    • -setUbiquitous:itemAtURL:destinationURL:error:move any local file to iCloud (or vice versa); one URL must be local and one must point into one of the iCloud containers
    • -startDownloadingUbiquitousItemAtURL:error:download the file content
    • -evictUbiquitousItemAtURL:error:delete iCloud file.

    Also check NSMetadataQuery and NSMetadataItem classes used to discover new iCloud files. iCloud will automatically give you only metadata of the file, but content must be downloaded explicitely (see the methods above)