Change app icon on the fly

Discussion in 'iOS Programming' started by coolman, Sep 14, 2008.

  1. coolman macrumors newbie

    Joined:
    Jul 12, 2008
    Location:
    La Coruna, Spain
    #1
    How can I change the app icon interactively when an action inside the app is done? (ie: pressing a buttom ..)
     
  2. Jeremy1026 macrumors 68020

    Jeremy1026

    Joined:
    Nov 3, 2007
    #2
    The only thing I could think of would be to edit the .plist file to point to a different app icon. If that is even possible?
     
  3. Sbrocket macrumors 65816

    Sbrocket

    Joined:
    Jun 3, 2007
    Location:
    /dev/null
    #3
    In terms of AppStore applications? You can't. Period. Doing so, first, is not allowed by the sandbox and, second, would invalidate the codesigning on your application bundle. If you need a numerical indicator, use the badges. Otherwise find another option.
     
  4. coolman thread starter macrumors newbie

    Joined:
    Jul 12, 2008
    Location:
    La Coruna, Spain
    #4
    Thanks,

    Where can I find more information regarding badges?
     
  5. Sbrocket macrumors 65816

    Sbrocket

    Joined:
    Jun 3, 2007
    Location:
    /dev/null
    #5
    Look in the UIApplication docs for the applicationIconBadgeNumber property. Very easy to use - just do something like this:

    Code:
    [UIApplication sharedApplication].applicationIconBadgeNumber = 5;
    
    You can then set it to 0 to clear the badge. These are the same badges that are used, for example, by Apple's Mail app.
     
  6. coolman thread starter macrumors newbie

    Joined:
    Jul 12, 2008
    Location:
    La Coruna, Spain
    #6
    That's great. This also fits for what I need.

    Thanks Sbrocket
     

Share This Page