Standard Loading Screen

Discussion in 'iOS Programming' started by Sergio10, Sep 28, 2009.

  1. Sergio10 macrumors regular

    Joined:
    Oct 3, 2007
    #1
    Hi,

    Is it possible to display screen while some data is loading?

    Workflow:
    When I press "Log In" button data load synchronously. And need to display screen with indicator like: "Please wait..."
    I saw it in iphone when check my bill.

    Is some standard to technique to implement it?

    Thank you.
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    The standard way of doing it is to not load the data synchronously. Use the asynchronous methods of NSURLConnection to load the data. When you start the async load display whatever view you want and then get rid of it when the data loads.

    If you do it synchronously the main thread blocks until this completes stopping you from changing the view/animating anything. Of course you could use the synchronous method in a separate thread, but it's probably easier to just use the async ones.
     

Share This Page