Spinning Cursor in status bar?

Discussion in 'iOS Programming' started by naximus, Oct 4, 2008.

  1. naximus macrumors newbie

    Joined:
    Oct 3, 2008
    #1
    Hi. Anyone knows how to get the spinner cursor to show-up in the status bar when app is busy? I tried a quick search on forum but no luck.


    If you don't know how to do the above then how would you pop message box telling user app is busy doing while showing the spinning cursor along side?


    Thanks in advance.
     
  2. Jeremy1026 macrumors 68020

    Jeremy1026

    Joined:
    Nov 3, 2007
    #2
    That spinner is displayed only when there is data being exchanged over a network. There is no other way to turn this activity indicator.
     
  3. SqueegyX macrumors regular

    Joined:
    Mar 24, 2008
    #3
    That's not exactly true

    Code:
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
     
  4. Jeremy1026 macrumors 68020

    Jeremy1026

    Joined:
    Nov 3, 2007
    #4
    Uuu, I stand corrected. Thanks :)
     
  5. xnakx macrumors newbie

    Joined:
    Oct 5, 2008
    #5
    It has been brought up that apple will deny any apps to the app store that uses that indicator for anything other that network activity.

    just a heads up.
     
  6. SqueegyX macrumors regular

    Joined:
    Mar 24, 2008
    #6
    Yeah, you do have to turn it on and yourself, but as a convention you should only do so to indicate network activity os happening. After all, it is the network activity indicator.
     
  7. xnakx macrumors newbie

    Joined:
    Oct 5, 2008
    #7
    An Apple rep told me that a lot of apps are using it as a "busy" indicator instead of adding/animating a activityIndicator in their app. Your right the phone knows when it is Trans/Recv it should be automatic.
     
  8. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #8
    It seemed to me that when I enabled the network activity indicator it just kept spinning even when my app was doing no networking. Is that what others are seeing? It's of no use to me if it's always spinning.

    Obviously I can't tell if some background app is using the network but it just kept spinning.

    Is the idea that your app should turn it on and off to indicate network activity? I guess that might work.
     
  9. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #9
    It's up to you to enable it when you are using the network and disable it when you stop: it's not automatic.
     
  10. xnakx macrumors newbie

    Joined:
    Oct 5, 2008
    #10
    if your started it spinning you also have to stop it.
    Code:
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
    i did this too and fought for hours looking thru my horribly organized code till i found that i started it but did not stop it after my net activity was finished
    :)

    Jason
     
  11. xnakx macrumors newbie

    Joined:
    Oct 5, 2008
  12. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #12
    OK, so it's no different than the regular spinning activity indicator just that its in the status bar. I didn't get that from reading the docs. I assumed it was detecting the network activity itself.

    Makes sense, sort of.
     
  13. naximus thread starter macrumors newbie

    Joined:
    Oct 3, 2008
    #13
    Thanks

    Thanks a lot guys for the discussion already...

    My real problem is that when my app loads up, its taking lots of time to actually show up. I know however that any work I do on the startup takes very little time in fact.

    I was thinking of using this spinning cursor within the status bar but after reading your writings I will not be.

    I need to at least be able to show something, other than a blank black screen but am just not sure how.....My app looks dead when it loads up for a good 6-8 seconds...

    My app use a small database and few images...i know that its at least 5 seconds in the loading process that my app actually begins loading data so I can't account for at least 5-6 seconds of this black screen on startup...

    any idea?
     
  14. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #14
    Read up on using a Default.png file.

    The iPhone OS takes its time setting up the app sandbox and loading your code and maybe xibs into memory before any of your initialization code gets called, but the Default.png can be displayed while this is going on. So display something (splash screen or dummy app view) that keeps the user's attention while waiting.


    .
     
  15. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #15
    If you run your app with ObjectAlloc (start with performance tool menu item) you should be able to get a clue about what's happing during your app startup. It shows a timeline of all the memory allocations and you can see the stack trace where the allocations were made.
     
  16. naximus thread starter macrumors newbie

    Joined:
    Oct 3, 2008
    #16
    Thanks a lot..that did it for now..something so simple but wasted so much time on....thanks again.
     

Share This Page