my app make a simple file called log.txt
the URL of this file (viewed in xcode) is file://localhost/var/mobile/Applications/NUMBER OF THE APPLICATION/Documents/
Here is how it works for me :
I just put the declaration "UIDocumentInteractionController *documentController" in the .h file and it works !
I really don't know why, but ....
Its a memory management issue. The main reason it crashes is because the object is not retained. Thats why if you declare it in the .h file and write an @property for retain when you do assign it the object gets retained.
So in your interface file (.h) you should have
@property (retain)UIDocumentInteractionController *documentController;
Then in your .m (implementation file) you can do
@synthesize documentController;
- (void)openDocumentIn{
// Some code here
self.documentController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
documentController.delegate = self;
documentController.UTI = @"public.text";
[documentController presentOpenInMenuFromRect:CGRectZero
inView:self.view
animated:YES];
// Some more stuff
}