initWithContentsOfURL question

  • Hi (again),

    How safe is it to retrieve data via the methods initWithContentsOfURL
    or stringWithContentsOfURL, rather than using NSURLConnection to
    retrieve the data asynchronously?

    Thanks in advance,

    Jesus
    __________________
    Jesus De Meyer
    www.edot-studios.com
    jesus.edot-studios.com
    "creativity in mind"
  • Um, what do you mean by "safe?"

    Ultimately you should get the same result. It's more convenient to use
    these methods than NSURLConnection but you do risk seriously blocking
    the main thread at the user's inconvenience.

    Mike.

    On 4 Nov 2007, at 14:18, Jesus De Meyer wrote:

    > Hi (again),
    >
    > How safe is it to retrieve data via the methods
    > initWithContentsOfURL or stringWithContentsOfURL, rather than using
    > NSURLConnection to retrieve the data asynchronously?
    >
    > Thanks in advance,
    >
    > Jesus
    > __________________
    > Jesus De Meyer
    > www.edot-studios.com
    > jesus.edot-studios.com
    > "creativity in mind"
  • > Um, what do you mean by "safe?"
    >

    Like, will it always do a remote connection to get the data or could
    it be that some classes only do local connections.

    > Ultimately you should get the same result. It's more convenient to
    > use these methods than NSURLConnection but you do risk seriously
    > blocking the main thread at the user's inconvenience.

    Yeah, I noticed that too, I think I'll use NSURLConnection instead.
    Wouldn't like to block the main thread that much.

    Thanks,

    Jesus
    >
    >
    > Mike.
    >
    > On 4 Nov 2007, at 14:18, Jesus De Meyer wrote:
    >
    >> Hi (again),
    >>
    >> How safe is it to retrieve data via the methods
    >> initWithContentsOfURL or stringWithContentsOfURL, rather than using
    >> NSURLConnection to retrieve the data asynchronously?
    >>
    >> Thanks in advance,
    >>
    >> Jesus
    >> __________________
    >> Jesus De Meyer
    >> www.edot-studios.com
    >> jesus.edot-studios.com
    >> "creativity in mind"

    __________________
    Jesus De Meyer
    www.edot-studios.com
    jesus.edot-studios.com
    "creativity in mind"
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today