All that found sensible in Google is:

NSURL *urlString = [NSURL URLWithString: @"http://hashcode.ru/"]; NSURLRequest *urlRequest = [NSURLRequest requestWithURL: urlString cachePolicy: NSURLRequestReturnCacheDataElseLoad timeoutInterval: 10]; NSURLResponse *response = nil; NSError *error = nil; NSData *urlData = [NSURLConnection sendSynchronousRequest :urlRequest returningResponse :&response error :&error]; NSString *result= [[NSString alloc] initWithData :urlData encoding: NSASCIIStringEncoding]; 

As I understand it, this is getting the code itself ... but I need to pull out the date, for example, " <dat>19.12.2013</dat> ", parsing from <dat> and to < insert in the label . Tell me the code ^^: ***



    2 answers 2

    There are lots of parsers on a githaba :

    • one
      You are asking for a parser for HTML, I gave you links. What exactly is incomprehensible to you? Ask questions. - AlexDenisov
    • 2
      There is a suspicion that the questioner does not quite understand what he ultimately needs))) - Stanislav Pankevich
    • @AlexDenisov, but do not tell the parser using the Core Foundation or in C / C ++? Gumbo not to offer, heavy. - neo

    I suspect that the easiest way is to use the AFNetworking library, which makes HTTP requests out of the box and parses HTTP responses: see examples on the project page, for example, AFXMLRequestOperation or AFJSONRequestOperation.

    Even besides solving problems with parsing, I would advise you to start using AFNetworking, as this is the most-already-long-used and all-all library used for working with the network: HTTP, request-responses, JSON, XML, ...

    • Still there is such a github.com/RestKit/RestKit - AlexDenisov
    • one
      I think for the questioner it will be too cool. - Stanislav Pankevich
    • I answer on the assumption that I see the sendSynchronousRequest in question and it is immediately alarming. - Stanislav Pankevich