I know this type of question asked previously on SO and I tried all the possible solution but didn't find any suitable solution of it.
I am working on a project in which i am using UIWebView
inside my UIViewController
to open an URL
.
WebView
open successfully and working fine but when i am trying to add image photo library popup open and when i tap on Photo Library button my current view controller dismissed and navigate to previous view and shows the following warning.
> Warning: Attempt to present <UIImagePickerController: 0x7fda28841c00> on <UrlTestViewController: 0x7fda27434860> whose view is not in the window hierarchy!
I am using the following code for webView
- (void)viewDidAppear:(BOOL)animated
{
NSLog(@"viewDidAppear loaded successfully");
NSString * addressForUrl = [NSString stringWithFormat:@"%@ %@",RcvdId,RcvdName];
NSLog(@"Address for url is %@",addressForUrl);
NSString *trimedString = [addressForUrl stringByReplacingOccurrencesOfString:@"," withString:@""];
NSLog(@"trimedString for url is %@",trimedString);
NSString *MaintrimedString = [trimedString stringByReplacingOccurrencesOfString:@" " withString:@"-"];
NSLog(@"trimedString for url is %@",MaintrimedString);
NSString * urlStr = [NSString stringWithFormat:@"http://rentingright.com/properties/writereview/%@",MaintrimedString];
NSLog(@"Complete URL is %@",urlStr);
//Complete Url http://rentingright.com/properties/writereview/104-21-North-Bruner-Street-Hinsdale-IL-USA
NSURL *videoUrl = [NSURL URLWithString:urlStr];
NSURLRequest *request = [NSURLRequest requestWithURL:videoUrl];
[webVw loadRequest:request];
}