0

i'm working on a jailbroken iphone with iOS 5.0.1, just want to access status bar image, and my code is as follows:

-(void)addStatusBarImage
{

    NSLog(@"addStatusBarImage");
    [[UIApplication sharedApplication] addStatusBarImageNamed:@"sgtest" removeOnExit: YES];

}

-(void)removeStatusBarImage
{

    NSLog(@"removeStatusBarImage");

    [[UIApplication sharedApplication] removeStatusBarImageNamed:@"sgtest"];

}

my problem is, the add function works fine, but removeStatusBarImageNamed seems useless as the "sgtest" image still exists in the status bar unless my app is terminated.

Vladimir
  • 170,431
  • 36
  • 387
  • 313
shaj04
  • 23
  • 4
  • If your interested in this question why not support the Area 51 proposal for a [jail-breaking Stack Exchange site](http://area51.stackexchange.com/proposals/18154/ios-jailbreaking-development?referrer=EuWVi6IpN0_KzzEhC7I-Qw2) – Richard Stelling Jan 02 '12 at 14:26

1 Answers1

1

status bar icon manager fix what thread have had set icon image. if another thread try to remove that icon, it fails. You need to do it in one thread. Check out SpringBoardAccess project at github. You can use it as is or implement like.