I’m having some trouble with the handleOpenURL method in my app delegate. I have a rootviewcontroller that should be shown normally, but when a file is opened in my app, I need the handleOpenURL method to present a new viewcontroller and send the url info. The problem is I can’t present a modal view controller from my app delegate. Also, when I try to call a method in my rootviewcontroller to present the modalviewcontroller I get
Warning: Attempt to present ... whose view is not in the window hierarchy!
So, I guess I’m just looking for a solution that will present a new modal view controller and pass the url information to that class. This is the app delegate method.
- (void)handleOpenURL:(NSURL *)url {
}
Thanks for your help
In your RootViewController,Create an instance of appDelegate just like
then subject
also create a callBackFunction eg:
-(void)callBack:(NSUrl *)url;Now in appDelegate class create a
propertyof yourRootViewControllerand in
appDelegateyour function as specified this way..