Search code examples
iosobjective-cuiwebviewphoto-gallery

Objective C : Webviewcontroller is reloading after opening photo gallery


I am working on an iOS application. In my app I have a viewController containing UIWebview. I loaded a url in that web view. There is a 'Upload' button in that webpage. When we click on that button it will open the phones photo gallery and user can select a photo from gallery.

My problem is after selecting any photo from gallery the view controller is getting reloaded and again the same url is opening in the web view. So I can't upload any files.

Anybody please help me. Please.

Thanks, AKS


Solution

  • Most Probably you are loading the url in webview in viewdidAppear: Try implementing it in viewDidLoad Method. ViewDidAppear will be called everytime another viewcontroller is dismissed