Important: Please read the Qt Code of Conduct -

iOS: OpenInMenu from Qt UI (UIDocumentInteractionController)

  • Qt Champions 2016

    just working on some more options for my sharing example app.
    to display the native iOS OpenIn... Dialog:

    UIDocumentInteractionController* documentInteractionController = nil;
    documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:nsFileUrl];
    UIViewController* qtUIViewController = [[[[UIApplication sharedApplication]windows] firstObject]rootViewController];
            [documentInteractionController retain];
            if(![documentInteractionController presentOpenInMenuFromRect:CGRectZero inView: qtUIViewController.view animated: true])
                // do something

    I had to explicitely retain the UIDocumentInteractionController - without this the URL gets lost and I cannot open the file in another App.
    I'm not so experienced with Obj-C, so my question is: do I also have to explicitely release the Controller - and if yes where should this be done.


Log in to reply