I would like to access the internet on an iPhone simulator in xcode. I would like to check out some urls in my code.
How is this possible?
Thank.
If you have an Internet connection on the development machine, the simulator uses this. There are no special things you need to do. Just make sure you are connected to the Internet using your mac
if you ask to check your Internet connection, you can use the Reachability class, available throughout the Internet. He can tell you if internet / url is accessible or not.
" URL- Safari ?". , :
NSURL *url = [NSURL URLWithString:@"http://www.google.com/"]; if (![[UIApplication sharedApplication] openURL:url]) NSLog(@"%@%@",@"Failed to open url:",[url description]);
, .
Remember that web page URLs must start with the http: // or https: // protocol indicator.
This is why the code
NSURL * url = [NSURL URLWithString: @ "www.google.com/"]
will not open Safari in the iOS simulator, whereas
NSURL * url = [NSURL URLWithString: @ "HTTP://www.google.com/"]
will be.
Source: https://habr.com/ru/post/1783608/More articles:Short Lists / Vectors in C ++ - c ++Why do we need Http handlers? - c #tinyMCE textarea в крошечном MCEPopup - javascriptVery different I / O performance in C ++ on Windows - c ++How to go to markers in different tabs in vim? - vimpreg_replace only OUTSIDE tags? (... we are not talking about the full "html analysis", just a little markdown) - htmlget one primary key value from datagridview in C # window forms - c #Strange database problem in django - djangoWays to run gacutil on a remote machine - scriptingПерестановки подмножеств и последующий анализ времени выполнения - javaAll Articles