Comment présenter UIAlertView depuis appDelegate

J'essaie d'afficher une UIAlertView de l'appDelegate dans
didReceiveRemoteNotification
lorsque l'application de recevoir une notification push.

J'ai cette erreur :

  Warning: Attempt to present <UIAlertController: 0x14c5494c0> on <UINavigationController:
  0x14c60ce00> whose view is not in the window hierarchy!

voici mon code :

func application(application: UIApplication, didReceiveRemoteNotification userInfo: NSDictionary) {

    var contentPush: NSDictionary = userInfo.objectForKey("aps") as NSDictionary

    var message = contentPush.objectForKey("alert") as String



    let alertController = UIAlertController(title: "Default Style", message: message, preferredStyle: .Alert)

    let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel) { (action) in
                    //...
    }
    alertController.addAction(cancelAction)

    let OKAction = UIAlertAction(title: "OK", style: .Default) { (action) in

        let photoPushedVc = self.storyboard.instantiateViewControllerWithIdentifier("CommentTableViewController") as CommentTableViewController

        println("the fetched post is \(post)")

        photoPushedVc.post = post

        let activeVc = UIApplication.sharedApplication().keyWindow?.rootViewController

        activeVc?.presentViewController(photoPushedVc, animated: true, completion: nil)
   }

   alertController.addAction(OKAction)

   let activeVc = UIApplication.sharedApplication().keyWindow?.rootViewController


   activeVc?.presentViewController(alertController, animated: true, completion: nil)}

source d'informationauteur jmcastel