uidocument

Rename an iCloud document

会有一股神秘感。 提交于 2021-02-09 05:12:38
问题 The problem What I have so far is code that creates a new local file and deletes the iCloud file. Is it possible to rename an iCloud document, so that it stays in iCloud? GarageBand can do it. It's possible to rename an iCloud song. After the rename is done, the song is still in iCloud. However GarageBand is an Apple app, so it may use private apis. My current code: - (void)moveFrom:(NSURL*)sourceURL moveTo:(NSString*)destinationName completion:(void (^)())completion { MyDocument *document =

Rename an iCloud document

☆樱花仙子☆ 提交于 2021-02-09 05:08:05
问题 The problem What I have so far is code that creates a new local file and deletes the iCloud file. Is it possible to rename an iCloud document, so that it stays in iCloud? GarageBand can do it. It's possible to rename an iCloud song. After the rename is done, the song is still in iCloud. However GarageBand is an Apple app, so it may use private apis. My current code: - (void)moveFrom:(NSURL*)sourceURL moveTo:(NSString*)destinationName completion:(void (^)())completion { MyDocument *document =

Rename an iCloud document

一曲冷凌霜 提交于 2021-02-09 05:05:54
问题 The problem What I have so far is code that creates a new local file and deletes the iCloud file. Is it possible to rename an iCloud document, so that it stays in iCloud? GarageBand can do it. It's possible to rename an iCloud song. After the rename is done, the song is still in iCloud. However GarageBand is an Apple app, so it may use private apis. My current code: - (void)moveFrom:(NSURL*)sourceURL moveTo:(NSString*)destinationName completion:(void (^)())completion { MyDocument *document =

Rename an iCloud document

微笑、不失礼 提交于 2021-02-09 05:04:41
问题 The problem What I have so far is code that creates a new local file and deletes the iCloud file. Is it possible to rename an iCloud document, so that it stays in iCloud? GarageBand can do it. It's possible to rename an iCloud song. After the rename is done, the song is still in iCloud. However GarageBand is an Apple app, so it may use private apis. My current code: - (void)moveFrom:(NSURL*)sourceURL moveTo:(NSString*)destinationName completion:(void (^)())completion { MyDocument *document =

Sharing a plist file using iCloud

眉间皱痕 提交于 2021-02-06 09:12:59
问题 I have a relativley simple app which persists data to a plist file located in the documents folder. The data loads into a UITableView at startup. The user can then edit, delete or add records and any changes get saved back to the plist file. Now I would like to share this data (the plist file) across devices using iCloud. I have looked at the documentation and my understanding is that I need to create a UIDocument to "manage" the plist file. I have looked at several iCloud tutorials however

Sharing a plist file using iCloud

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-06 09:12:34
问题 I have a relativley simple app which persists data to a plist file located in the documents folder. The data loads into a UITableView at startup. The user can then edit, delete or add records and any changes get saved back to the plist file. Now I would like to share this data (the plist file) across devices using iCloud. I have looked at the documentation and my understanding is that I need to create a UIDocument to "manage" the plist file. I have looked at several iCloud tutorials however

iOS5.1: synchronising tasks (wait for a completion)

半世苍凉 提交于 2020-01-22 12:37:06
问题 I have a basic problem synchronizing openWithCompletionHandler: (UIManagedDocument) with the main activities. Situation: I have a singleton class managing a shared UIManagedDocument. This class provides one method which should deliver the document in a normal state (i.e. creates or opens it, whatever is neccessary). But because openWithCompletionHandler: does its main job asynchronously in the background my program should wait with setting up the fetchedResultsController until the document is

Pick UIDocument automatically in UIDocumentBrowserVC

本小妞迷上赌 提交于 2020-01-15 10:24:11
问题 I am using a uidocumentbrowservc and want to pick a UIDocument programmatically. In my case it is because i want to automatically load the last used UIDocument to save the user some time on launch, as my app seldom changes documents. My naive approach is to store last used URL in UserDefaults . Then in the viewDidLoad() of my uidocumentbrowservc I call presentDocument(at: URL) . But it doesn't work. And when i call URL.checkResourceIsReachable() I get the error: Error Domain

UIDocument loadFromContents fails with EXC_BAD_ACCESS [duplicate]

大城市里の小女人 提交于 2020-01-14 14:56:06
问题 This question already has an answer here : EXC_BAD_ACCESS using iCloud on multiple devices (1 answer) Closed 6 years ago . I have a pretty simple IOS app using iCloud document storage. Everything was working and then at some point I began encountering a EXC_BAD_ACCESS error in my document load method for at least one iCloud document, although most files load just fine. - (BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName error:(NSError *__autoreleasing *)outError { file =

Xcode 9.2 UIDocumentBrowserViewController : Failed to create a url from bookmarkableString

半城伤御伤魂 提交于 2020-01-11 19:59:50
问题 Update: Xcode 9.3 has fixed it. When creating UIDocument File in UIDocumentBrowserViewController [default] [ERROR] Could not resolve bookmark. Error: Error Domain=NSFileProviderInternalErrorDomain Code=1 "The reader is not permitted to access the URL." UserInfo={NSLocalizedDescription=The reader is not permitted to access the URL.} [DocumentManager] Failed to create a url from bookmarkableString (Error Domain=NSFileProviderInternalErrorDomain Code=1 "The reader is not permitted to access the