No Internet Connection

Discussion in 'iOS Programming' started by Alexj17, Oct 8, 2010.

  1. Alexj17 macrumors newbie

    Aug 17, 2010
    Hey All

    I am a little confused on how to go about and do this....

    On each page of my app i connect to PHP file to drag in data from my server. I have about 10 pages. Now if there is no connection to the internet then of course now data can be received.

    Often the app crashes and we are putting this down to not having the data due to a change in connection or wifi whatever.

    Now i have setup the reachability thing and that works, but i dont know how to link this in with the PHP calls. Should i check the reachability and if no connection then dont run the call. If so, what about all the variables, they will still be null and cause an error then?

    I dont really know what is the best solution.

    Hope you can help
  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State

    Your app probably needs to handle the possibility that the data is null. If your app is completely reliant on an internet connection, you should check for that upon startup and notify the user if it's not available. Then I think all you can do is leave the app in a sort-of "limbo" state.

Share This Page