Questions tagged [uidocument]

UIDocument represents a user-editable document in an iOS application. It is an abstract base class in the UIKit framework. When it is used, its subclass takes the role of the model of a model-view-controller application. Because it implements the NSFilePresenter protocol, it significantly simplifies writing a document-based iOS application. Its Mac OS counterpart is NSDocument.

UIDocument represents a user-editable document in an iOS () application. It is an abstract base class in the UIKit () framework. When it is used, its subclass takes the role of the model of a model-view-controller application. Because it implements the NSFilePresenter protocol, it significantly simplifies writing a document-based iOS application. Its Mac OS () counterpart is NSDocument ().

To learn more, see the Document-Based App Programming Guide for iOS.

268 questions
4
votes
0 answers

Data Size Limits for iCloud Document Storage

Is there a way to know if the iCloud document storage quota is exceeded? Is there something similar to NSUbiquitousKeyValueStoreQuotaViolationChange key of NSUbiquitousKeyValueStoreDidChangeExternallyNotification notification for iCloud document…
Ganesh Kamath
  • 1,181
  • 11
  • 20
4
votes
0 answers

Why would -[UIDocument revertToContentsofURL:] be called automatically?

I have a subclass of UIDocument called Song that I use for storing users' content locally. The main reason I'm using UIDocument is for the autosaving feature. I have an issue where after autosaving a document, -[Song revertToContentsOfURL:] is…
Jayson
  • 1,689
  • 14
  • 26
4
votes
0 answers

NSMetadataQuery sorting by update date is not working

I am trying to sort the results of a NSMetadataQuery by update date but it is not working. Here is my code: self.query = [[NSMetadataQuery new] autorelease]; [self.query setSearchScopes:@[NSMetadataQueryUbiquitousDataScope]]; NSSortDescriptor…
Thomas Castel
  • 553
  • 1
  • 6
  • 11
4
votes
2 answers

Rename an iCloud document

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…
neoneye
  • 50,398
  • 25
  • 166
  • 151
4
votes
0 answers

openWithCompletionHandler never calls completion block in iPhone5

Recently I run into a strange problem and I'd be interested, if somebody has experienced the same. I'm working on an iCloud-enabled application, which uses (void)openWithCompletionHandler:(void (^)(BOOL success))completionHandler for some files,…
Tommy356
  • 252
  • 2
  • 7
4
votes
1 answer

openWithCompletionHandler prob in 5.1 sim

I'm puzzled. I'm finding that the UIDocument method openWithCompletionHandler works in the iOS 5 and IOS 6 sims, but not in the one for iOS 5.1. Any thoughts on how I work around this? Is it just one of those things where the sim falls down but…
sberley
  • 2,238
  • 1
  • 16
  • 12
4
votes
1 answer

How do I make NSMetadataQuery see my saved documents' folders as packages?

I'm writing an app which saves and loads documents both locally and on iCloud. Locally is working fine, but I'm having a problem with iCloud. The documents are saved as a package - the UIDocument reads and writes an NSFileWrapper which contains an…
Simon
  • 25,468
  • 44
  • 152
  • 266
3
votes
1 answer

UIDocument and a NSDictionary

I'm trying to figure out what exactly the UIDocument subclass should look like when the file I'm trying to sync/share via iCloud is essentially an NSDictionary. The dictionary file (plist) has a bunch of keys that are primary keys. each key could…
user134611
  • 766
  • 1
  • 11
  • 22
3
votes
1 answer

Disable action items in UIDocumentInteractionController's presentPreviewAnimated

I am using UIDocumentInteractionController's presentPreviewAnimated method to preview document. It works fine. But I wish to disable the action button while in the preview mode. I have the following two delegated methods to return NO. But these…
user523234
  • 14,323
  • 10
  • 62
  • 102
3
votes
0 answers

How to resolve Error on closing document picker

Setting up a document picker where users can select PDF files from the 'Files app' and save this to my app document folder to use in the app. Got the document picker to open, select file - but upon closing I get the following…
Nicholas Farmer
  • 773
  • 7
  • 32
3
votes
1 answer

How to get file name and file size from UIDocumentPickerViewController in iOS 14?

I have to create feature for upload some document in pdf type and have to show name and file size with file that I selected from UIDocumentPickerViewController 's delegate before upload it. How can I get its name and file size ?
Nawin P.
  • 223
  • 1
  • 4
  • 11
3
votes
2 answers

iOS 11 Drag and Drop UIDocument

Everything is clear about Drag and Drop except how to handle UIDocuments. this is my (not working) implementation... For Drag: func tableView(_ tableView: UITableView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) ->…
Enlil
  • 1,027
  • 14
  • 28
3
votes
0 answers

Using plist or JSON as a UIDocument format in iOS10/Swift3

My application has a very basic document similar to a contact card, along with a series of images. I am using UIDocument because I want to have iCloud syncing. I'm trying to decide how to store the little text information I need, and it would seem…
Maury Markowitz
  • 9,082
  • 11
  • 46
  • 98
3
votes
1 answer

DocumentPickerViewController in Move or Export mode dismissed with a nonexistent URL (making a document provider app extension)

I'm currently trying to implement functionality for Move and Export Modes. All I do is have the user navigate to the directory they want to move/export their file to, then call dismissGrantingAccessToURL on the the directory they choose, with the…
arcticmatt
  • 1,956
  • 1
  • 19
  • 36
3
votes
1 answer

Open UIDocument synchronously

I am currently redesigning my existing app from CoreData storage to a document based app using UIDocument subclasses. This is mainly to be able to introduce iCloud synchronization, since there is ongoing issues with iCloud sync in CoreData. At some…
user826955
  • 3,137
  • 2
  • 30
  • 71