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
0
votes
1 answer

Sending local/ubiquitous documents to opposite location and avoid double-named documents

My document-based app makes use of iCloud. Just as Apple suggest in their documentation I automatically create document names based on existing documents i.e Notes 1, Notes 2, Notes 3 etc. and move documents between the local and ubiquitous store…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
0
votes
1 answer

How to check a UIDocument is in iCloud

What’s the most convenient method to check whether a document is in iCloud or not? Initially I was going to remove the last path component and compare the item url with the container url (assuming it’s non-nil) but realised that it doesn’t take into…
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
0
votes
1 answer

How to implement file coordination in UIDocument

I already implemented UIDocument functionality (contentsForType:error:, SaveToURL:forSaveOperation:completionHandler:, loadFromContents:ofType:error:) to store simple text files in iCloud. How do I implement file coordination? What are the…
Aнгел
  • 1,361
  • 3
  • 17
  • 32
0
votes
1 answer

is it ok to create many instances of UIDocument?

Apple's Document-Based App Programming Guide for iOS shows example code that builds a list of FileRepresentation objects to show a document index. No instances of UIDocument are created initially. Then, when a document is opened, the UIDocument…
Taylor
  • 5,871
  • 2
  • 30
  • 64
0
votes
1 answer

iOS - UIDocument Versioning

I want to add versioning to my UIDocument local storage setup. In each of my classes that needs to be stored locally, I overwrite encodeWithCoder: and initWithCoder: like so: #define kLovelyString @"LovelyString" - (void)encodeWithCoder:(NSCoder…
rizzes
  • 1,532
  • 20
  • 33
0
votes
1 answer

Opening UIDocument in a loop

I am trying to open several UIDocument instances in a loop, using - (void)openWithCompletionHandler:(void (^)(BOOL success))completionHandler. To be precise, I am loading a file list from the document folder, and each file representing a user which…
user826955
  • 3,137
  • 2
  • 30
  • 71
0
votes
1 answer

UIManagedDocument does not save to disk

I followed the Stanford iOS 7 course of Fall 2013 and I'm getting used to all the concepts, though I encounter a problem with Core Data's UIManagedDocument and persistent saving. My application is similar to the courses one, and all the Model/Object…
0
votes
1 answer

UIDocument openWithCompletionHandler receives NO and a UIDocumentStateSavingError when opening an iCloud document after App was terminated

My app uses a single document (UIDocument) to contain its information and never closes it while the app is open. I have implemented iCloud connectivity to save the file so I can share it across devices. When using the simulator (iOS7), I can open…
Greg Walters
  • 181
  • 5
0
votes
2 answers

Can my app let users save some files to iCloud and rest on device

In Apple's Document Based App Development Guide, it emphasizes that our app should let users choose either to save all their files to iCloud or save all on local device. Is there reason for this? Can we actually allow users to pick some files to be…
CodeBrew
  • 6,457
  • 2
  • 43
  • 48
0
votes
1 answer

NSDocument and NSFileWrapper: strategy to reduce memory footprint?

Based on the Apple Docs, the recommended practice for using file packages with NSDocument seems to be to keep a reference to the root NSFileWrapper in the custom NSDocument implementation. My question: doesn't this mean that I'll end up with twice…
Mark
  • 6,647
  • 1
  • 45
  • 88
0
votes
1 answer

Is it safe to dismiss a viewController without closing the document Object

My application is a document based application I present the saved content using an UIViewController subclass EditViewsController with the help of my customized UIDocument object. EditViewsController will look like below Tapping the close Button on…
vignesh kumar
  • 2,310
  • 2
  • 25
  • 39
0
votes
0 answers

Attch project file to email

Not sur if this is duplicate question, but I couldn't find any answer. So In my app I creating files by subclasing UIDocument. Files are stored in Documents app folder. Now I'm trying to attach one of created files to email by code below: NSError…
metal_man
  • 580
  • 1
  • 9
  • 22
0
votes
0 answers

What does NSUndoManager do to my UITextView?

I am having trouble directing the undos from a UITextView to the UIDocument's undo manager. As I understand it when a user types in the UITextView it should register the undo with the closest undoManager in the responder chain, however I have added…
user1043479
  • 288
  • 1
  • 10
0
votes
0 answers

NSKeyedUnarchiver can't decode my string

I am trying to make a document-based application where it needs to decode the content using NSKeyedUnarchiver. However, it failed to extract the information even though there is indeed data containing! The following is my code, and also the…
donkey
  • 4,285
  • 7
  • 42
  • 68
0
votes
0 answers

View object having a reference on model object?

I am developing an document based application using MVC pattern, my model object is Mutablearray of mutableDictionaries. Each dictionary in the array is represented to the user by a View object. (for example if the array contain 100 dictionaries…
vignesh kumar
  • 2,310
  • 2
  • 25
  • 39