objective c - Downloading HTML string into an NSString or Swift String variable in iOS -


optional titles

  • How to download a web page data in Objective-C
  • How to download web page data in Swift?
  • Save the HTML pages in an NSString
  • Save the HTML pages in an NSString
  • Blockquote>

    How do you get web page data and put data in the string?

    Something like this:

    NSString * webpagebody = GetWebPageData ("www.mysite.com/webpage.html"); In

    WebpageBode , I would like to see "html my web page html".

swift 3.0

guard URL = url (string: "http : //www.example.com ") and {return} <{Html} =

Swift 2.3 try html < // headl 'error' here}

purpose-c

  NSString * url = @ "http://www.example.com"; NSURL * urlRequest = [NSURL URLWithString: url]; NSError * err = Zero; NSString * html = [NSString stringWithContentsOfURL: urlRequest Encoding: NSUTF8StringEncoding Error: & amp; Err]; If (mistake) {// handle}  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -