0

I am trying to save a UIDocument locally (for when the user has iCloud turned off). This is proving to be a challenge. Every time I try to save it, the save fails. Are there any errors I can access? Does anybody have any idea why this would fail? Thanks!

Clint Warner
  • 1,265
  • 1
  • 9
  • 25
  • What is the difference between UIDocument and UIManagedDocument? – Clint Warner Feb 20 '14 at 20:31
  • Here, check this http://stackoverflow.com/questions/11933055/uidocument-openwithcompletionhandler-crash and also a tutorial to check your workflow http://www.raywenderlich.com/12779/icloud-and-uidocument-beyond-the-basics-part-1 – DogCoffee Feb 20 '14 at 21:06

1 Answers1

0

From the documentation on UIDocument:

- (void)handleError:(NSError *)error userInteractionPermitted:(BOOL)userInteractionPermitted 

This method is called by the default implementations of openWithCompletionHandler: and saveToURL:forSaveOperation:completionHandler: when UIDocument encounters a reading or writing error, respectively.`

If you implement this method you should be able to examine the NSError in there to determine the cause of the failure.

Jeff Loughlin
  • 4,134
  • 2
  • 30
  • 47
  • I am using the saveToURL method, which calls the method you mentioned. This method does not have any error information however – Clint Warner Feb 20 '14 at 20:30
  • @ClintWarner: Look at handleError:userInteractionPermitted: in the documentation for UIDocument. Answer edited. – Jeff Loughlin Feb 20 '14 at 20:39