title: LibStatusBar icon disappears on 3rd-party app launch
body: <p>I wrote a tweak for Cydia, it adds an icon to the status bar.
  It works fine on the home screen and when SpringBoard is launched, also, if an app is already launched then it works fine,
  however, if an app (such as Facebook or Twitter) is closed (completely) and the icon is showing, when launching the app, it will cause the icon to disappear.
  The icon is displayed using libStatusBar using this code:</p>
  
  <pre><code>if(icon) // if icon needs to be removed
  {
      [icon release];
      icon = nil;
  }
  
  ...
  
  // add the icon to the status bar
  icon = [[%c(LSStatusBarItem) alloc] initWithIdentifier:[NSString stringWithFormat:@"muteIconLablabla"] alignment:StatusBarAlignmentRight];
  icon.imageName = [NSString stringWithFormat:@"Mute"];
  </code></pre>
  
  <p>I also tried using the methods suggested in <code>libStatusBar</code> README file</p>
  
  <pre><code>[[UIApplication sharedApplication] addStatusBarImageNamed:@"ON_Mute"]; // and removeStatusBarImageNamed:...
  </code></pre>
  
  <p>I tried overriding <code>-(id)init</code> and updating the icon there, but the same result.</p>
  
  <p>The code shown above is being called from a <code>static void</code> function. this function is being called several times, for example from <code>-(void)applicationDidFinishLaunching:(id)application
  </code> under <code>%hook SpringBoard</code> and <code>-(void)ringerChanged:(int)changed</code></p>
  
  <p>All inside <code>Tweak.xm</code>.
  The problem happens in <code>iOS7</code> as well.</p>