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.