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
2
votes
2 answers

NSMetadataQuery does not find NSFileWrapper folder bundles, only files (but they're there)

I have a strange problem which I can't seem to solve on my own. Any help or thought is appreciated. The problem: NSMetadataQuery finds normal files (like test.txt) but no filewrapper bundle (myWrapperDocument.pro) However, NSFileManager finds all…
auco
  • 9,329
  • 4
  • 47
  • 54
2
votes
0 answers

In UIDocument completion handler never gets called in IOS 5 but works in IOS 6

In UIDocument completion handler never gets called in IOS 5 but works in IOS6
user1010819
  • 2,691
  • 3
  • 15
  • 14
2
votes
1 answer

Why is loadFromContents called after an autosave of my UIDocument?

I have an iOS app that implements a custom subclass of UIDocument that encapsulates a file wrapper on a package of data, archived objects and images. I initially converted the implementation to UIDocument for iCloud support but it has been too…
Dave Ross
  • 673
  • 4
  • 12
2
votes
0 answers

UIDocument opening is never finished

I have an iOS 5.1 app, and I'm trying to optimize it for iOS 6. The problem is that openWithCompletionHandler: is never finished. As I see, second device can't download this file. But device-owner works with file fine. My app uses 2 file types: the…
Riddick
  • 375
  • 4
  • 14
2
votes
0 answers

UIManagedDocument fileModificationDate doesn't change

Opening, closing, changing data and saving the document using the proper UIDocument Saving API methods will not change the value returned from the fileModificationDate property. From the docs: The modification date is updated by the…
2
votes
1 answer

Storing an audio file in a UIDocument

I have a little app that works with iCloud. It stores audio files into the cloud. I noticed that loading the audio files from a second device doesn't work immediately. So I implemented - (BOOL)downloadFileIfNotAvailable:(NSURL*)file That helped…
Joseph
  • 9,171
  • 8
  • 41
  • 67
2
votes
1 answer

Why does it take UIDocument 40 seconds to load?

I'm trying to load an UIDocument for a quick preview of its contents (which are wrapped up in a file wrapper). I call this code: -(void)previewLoadDocAtURL:(NSURL*)fileURL { NSLog(@"... loading for preview: %@", [fileURL…
n.evermind
  • 11,944
  • 19
  • 78
  • 122
2
votes
2 answers

UIDocument open/close behavior

I have a UIDocument based app, without iCloud support. The user is able to create documents, and save them to app's Document directory. I have also created few "sample" documents, and passing them with the app's bundle. I want the user to be able to…
Andrei G.
  • 1,710
  • 1
  • 14
  • 23
2
votes
2 answers

Large array of UIDocuments for iCloud

I have a project with iCloud sync, but it doesn't work correctly at all. At first, I get an array of changed objects, then I convert them to CSV strings (which will be the contents of UIDocuments in cloud) and then I upload them to iCLoud. If I have…
Dmitry Zhukov
  • 1,809
  • 2
  • 27
  • 35
1
vote
1 answer

iCloud NSFileManager API - game score storage

I currently have an iOS application for which I would like to enable iCloud score storage so that users will have their game progress synced across their devices. The users progress is stored in multiple plist files in the sandboxes documents…
JNK
  • 1,753
  • 8
  • 25
  • 37
1
vote
1 answer

NSCoder + UIDocument: are they compatible?

This is probably a naive question - but I want to double check to avoid wasting time with UIDocument if it doesn't do what I want. Background: I have an app for which I have created a simple file system to save out user created documents as plists.…
spring
  • 18,009
  • 15
  • 80
  • 160
1
vote
0 answers

UIDocumentStateSavingError for file in the iCloud: possible causes and how to recover

With the coming update, our iOS app is supposed to export data to a text file in the iCloud and to import data from it. The implementation is mostly completed and we started beta-testing. Everything seems to be working fine for all but one of the…
cg.
  • 3,648
  • 2
  • 26
  • 30
1
vote
1 answer

UIDocument with Autosave when is the file saved

I setting up UIDocument to save my files to the device. I mark a file needs to be saved with [ myDoc updateChangeCount:UIDocumentChangeDone ] Now it appears that the saving operation only kicks in when one is leaves the app. Now what would happen…
reza23
  • 3,079
  • 2
  • 27
  • 42
1
vote
1 answer

Clarification on UIDocument in iOS 5

I need a little clarification working with UIDocument and I have 3 related questions -1. In the call: -(id)contentsForType:(NSString *)typeName error:(NSError **)outError from where does the UIDocument pickup the typeName. Is it from "Document…
reza23
  • 3,079
  • 2
  • 27
  • 42
1
vote
1 answer

Renaming UIDocument using UINavigationItemRenameDelegate

I'm trying to rename UIDocument open via document browser (UIDocumentBrowserViewController). You can rename open documents in Apple Pages and Apple Numbers, and they use the usual UINavigationItemRenameDelegate controls. Do these apps have special…
Tritonal
  • 607
  • 4
  • 16