views:

24

answers:

1

I am looking to retrieve information from particular webs pages for an iPhone app. What I have in mind is to load the html source code into a string and parse the string for info that I need, but I have no clue how to load a web page source code into a string, or if it is possible at all.

So my questions would be:

  1. How to load an web page into workable format for iPhone?

  2. Do objective C strings have limits for size? (page may contain source code of up to 1MB)

Any help is appreciated.

A: 

Hi,

you could use [NSString stringWithContentsOfURL:encoding:error:] or [NSString stringWithContentsOfURL:usedEncoding:error:] to read contents of a URL. I have not tried it, but you could give it a try. Check out the docs for further informations.

I'm also not so sure if NSStrings have any limits.

Hope it helps.

Buju