Dismiss popover /popups when applicationDidBecomeActive

Discussion in 'iOS Programming' started by nixonjan, Sep 8, 2011.

  1. nixonjan macrumors newbie

    Joined:
    Sep 8, 2011
    #1
    The problem is following :

    when i click on phone number on webview - appears popoverController (see attachement). after minimizing and restoring app I need to dismiss this popover to prevent appears over login screen (popup2)

    I need to dismiss it on applicationDidBecomeActive. Please explain how to find appropriate popover to dismiss

    Thanks in advance
     

    Attached Files:

  2. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    Well, google knew within 10 seconds.
    From your UIPopoverController ->

    Code:
    [popoverController dismissPopoverAnimated:YES];
    That's it..
     
  3. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #3
    I'm not sure that's going to work if I understand this correctly. The poster does not "own" the popover. I think it's created/owned by the data detectors running in the web view?
     
  4. nixonjan thread starter macrumors newbie

    Joined:
    Sep 8, 2011
    #4
    no it is not so easy :) at the moment of return back we haven't popoverController to call its method (dismissPopoverAnimated:YES), also I don't know to which viewcontroller it belongs

    ----------

    yes !

    one possible solution to catch event of appearing mentioned popover and getting its pointer - but where and how - I don't know
     
  5. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #5
    Doesn't dismissing the popover as the application becomes inactive work just as well?
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    This still does not address how one dismisses a popover one does not own: the UIWebView data detectors are creating and displaying the popover...
     
  7. nixonjan thread starter macrumors newbie

    Joined:
    Sep 8, 2011
    #7
    I need to have poiner to dissmis it :( I have not ...
     
  8. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #8
    Ooooh, now I see it, this is one of those automated created ones.
    Can't you make a for in loop?

    Code:
    for (UIPopoverController *pop in self.view)
    {
     [pop dismissPopoverAnimated:YES];
    }
    Not sure if that would work, just saying something.
     
  9. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #9
    Why would the controller be in the view? The view the controller controls will be. But I don't know if you can link a view back to a view controller back to the popover controller easily (or at all)
     
  10. Sykte macrumors regular

    Joined:
    Aug 26, 2010
    #10
    Interesting problem. Having you tried disabling data detectors when the view disappears then re-enable them when view will appear? Shot in the dark.
     
  11. nixonjan thread starter macrumors newbie

    Joined:
    Sep 8, 2011
    #11
    I have made some investigation and found that this looks like ABUnknownPersonViewController http://developer.apple.com/library/...lerDelegate_Protocol/Reference/Reference.html

    so I will try to set delegate ABUnknownPersonViewControllerDelegate and catch appropriate event ...
     

Share This Page