UIWebView Image Upload reloading webview Objective c

406 views Asked by At

I am using UIWebview to show user profile details. Now when trying to upload the image whole Webview reloading and showing back to the same stage before uploading.

UIWebView *ProfileCellWebview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, cell.layer.frame.size.width, (MainFrame.size.height - 210))];
            [ProfileCellWebview setBackgroundColor:[UIColor clearColor]];
            NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:USERPROFILEPUBLIC,self.appDelegate.currentUser.userId]];
            NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
            [ProfileCellWebview setDelegate:self];
            [ProfileCellWebview loadRequest:requestObj];
            [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
            [cell addSubview:ProfileCellWebview];

Where i am doing wrong

1

There are 1 answers

0
AKS On

Implement the code to load the url in viewDidLoad. Hope you write the code in viewWillApear or viewDidApper.