How to get data PUSHED from JSON

Discussion in 'iOS Programming' started by Branda22, Aug 12, 2013.

  1. Branda22 macrumors newbie

    Joined:
    Jun 17, 2013
    Location:
    Curitiba, Brasil
    #1
    I'm confused as to how one gets data pushed from a JSON feed. I've been using NSJSONSerialization JSONObjectWithData. I can only pull the data.

    I'm getting the data from http://api.apirates.com/api/update


    Thank You.
     
  2. dantastic macrumors 6502

    dantastic

    Joined:
    Jan 21, 2011
    #2
    You make a request for data to a web service, the service will then reply. The response may be JSON formatted.

    Don't think of this as push or a pull, just think of it as asking a person on the street what time it is. You can't really control how that person is going to answer that question, if at all.

    When you say you can pull data, what does that look like in code?
    How do you suggest you'd push data instead?
     
  3. Branda22 thread starter macrumors newbie

    Joined:
    Jun 17, 2013
    Location:
    Curitiba, Brasil
    #3
    so in the case of a stock quote feed, I need to write code to make automated requests, in order to update the code?
     
  4. dantastic macrumors 6502

    dantastic

    Joined:
    Jan 21, 2011
    #4
    Yea, so if you want an update you have to ask for it. It's not like listening to the radio where you have a constant stream of information. It really is just like asking a random person on the street for the time. If in a few min you need to know if the time again you have to ask again - He won't stay around to tell you every time mickey's hand moves a bit.
     
  5. Branda22 thread starter macrumors newbie

    Joined:
    Jun 17, 2013
    Location:
    Curitiba, Brasil

Share This Page