Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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];
    if(qtUIViewController!=nil)
    {
            [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.

    thx


Log in to reply