0

I'm passing some value to server url and display it in UIWebView. Yesterday it was working, but it displaying enable cookies. Does i need to change the NSURL?

UIWebView *webview=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 320,480)];
     NSURL *url=[NSURL URLWithString:[NSString stringWithFormat:@"http://server.net/projects/checkout/cart/add?product=%d",i]];
    NSURLRequest *nsrequest=[NSURLRequest requestWithURL:url];
    [webview loadRequest:nsrequest];
    [self.view addSubview:webview];
user3351727
  • 67
  • 4
  • 14
  • http://stackoverflow.com/questions/9794999/enable-cookies-in-uiwebview-iphone - Check this link, may be it will helpful. – Himanshu padia Mar 26 '14 at 05:20
  • If i use below code it will work only on second time run the app. It won't works on first time run the app [[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"UserAgent": @"custom agent" }]; – user3351727 Mar 26 '14 at 05:39

0 Answers0