Notes for using iCloud in iOS (Xcode7.2)

Source: Internet
Author: User

Notes for using iCloud in iOS (Xcode7.2)

There are many articles on how to use iCloud in your App. Here, I will focus on some of the problems this cat has encountered and hope to help the first-time kids shoes.

1. Solve the problem with invalid TeamId

Some articles point out that when calling the NSFileManager instance method URLForUbiquityContainerIdentifier:, you can pass a combined container ID or nil. if nil is passed, the URL of the first container in iCloud is obtained (if you have multiple containers ).

If you pass an actual container ID, apple wants you to follow the TeamID. this ID is generated by BundleID combination (as described in a book ). however, in practice, the container URL returned by this method is always nil, and TeamID is obtained from the developer ID description page on the developer website.

However, if nil is passed as described above, the container URL can be obtained.

Open the. entitlements file generated by Xcode and you will see that the TeamID is not the so-called TeamID, but only the string "iCloud ":

So we can change TeamID to iCloud in the code, and I try to modify its prefix directly in Xcode Capabilities:

However, an error is prompted during compilation, which means that the prefix of the cloud must start with the cloud. <喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4NCjxwPrWrztKyu8XFs/3T0Mbky/ghost = "2 How to see the actual file name in icloud on ios devices"> 2. How to see the actual file name in iCloud on iOS devices

We all know that on iOS devices, for example, in the iPhone's iCloud settings, we can see every App that uses iCloud, where we can see the files saved by the App in iCloud.

However, some children's shoes may find that their own apps do not see the corresponding file name in iCloud, but only display a general size:

So how can we make it show specific files?

In fact, it is very easy to put your folder or file under the Documents folder under the root directory of the iCloud container.

As shown in, I have created the mystring.txt file and Tools Folder IN THE documentsfolder.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.