Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved iOS: OpenInMenu from Qt UI (UIDocumentInteractionController)

    Mobile and Embedded
    ios sharing
    1
    1
    471
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ekkescorner
      ekkescorner Qt Champions 2016 last edited by

      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

      ekke
      Qt Champion
      mobile business apps
      Qt Quick Controls 2 (Material style) for Android / iOS

      1 Reply Last reply Reply Quote 0
      • First post
        Last post