0

How to run a URL in Xcode objective-c without using uiwebview

I try this code but its not work

UIWebView *webView = [[UIWebView alloc]init];
[webView loadRequest:[NSURLRequest requestWithURL:myURL]];

the url like this:

@"http://www...com/library/ws_setLike.php?book_ID=%@&user_ID=%@",bookID,userID];
NamshanNet
  • 426
  • 1
  • 6
  • 20

2 Answers2

0

For non https urls you must allow arbitrary loads in NSAppTransportSecurity:
NSURLSession/NSURLConnection HTTP load failed on iOS 9

Community
  • 1
  • 1
arturdev
  • 10,884
  • 2
  • 39
  • 67
-1

I think this should do the trick: (This is of course on the assumption that if you do not want to use a UIWebView you will want to use the default browser on the device)

[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"http://www...com/library/ws_setLike.php?book_ID=%@&user_ID=%@",bookID,userID]];
Dom Bryan
  • 1,238
  • 2
  • 19
  • 39