Some things to keep in mind about using icloud in iOS (Xcode7.2)

Source: Internet
Author: User

Panda Pig • Patty original or translated works. Welcome reprint, Reprint please indicate the source.
If you feel that the writing is not good please more advice, if you feel good please support a lot of praise. Thank you! Hopy;)

There are many articles on how icloud is used in your app, and here are some of the questions that the cat has to focus on in the hope that it will help the first contact with the children's shoes.

1. Invalid resolution using Teamid

Some articles indicate that when invoking Nsfilemanager's instance method Urlforubiquitycontaineridentifier:, you can pass a combined container ID, You can also pass nil. If you pass nil, you get the URL of the first container in icloud (if you have multiple containers).

If you pass an actual container ID, Apple wants you to generate that ID in a combination of Teamid.bundleid (which is stated in a book). But actually, the container URL returned with this method is always nil, Teamid is obtained from the Developer ID description page in the developer's website.

However, if you pass nil as described above, you can get to the container URL.

When you open the. entitlements file that Xcode generates for you, you can see that the teamid is not so-called teamid, but simply the string "ICloud":

So we changed the Teamid to icloud in the code, and I tried to modify the prefix directly in Xcode's capabilities:

However, the compile-time prompt has an error, presumably meaning that the icloud prefix must start with icloud.

But I do not rule out that there are other ways to modify the prefix.

2. How to see the actual file name in icloud on your iOS device

Everyone knows that every app that uses icloud can be seen on iOS devices, like the iphone's icloud settings, where we can see the files that the app saves in icloud.

But some children's shoes may find that the app they're writing doesn't see the corresponding file name in icloud, but only shows a general size:

So how do you get it to display a specific file?

It's really simple, just put your folders or files under the Documents folder in the icloud container root directory.

As shown, I have created the MyString.txt file and Tools folder in the Documents folder.

Some things to keep in mind about using icloud in iOS (Xcode7.2)

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.