1

So, I have a status bar app that, when I click on it, does a bunch of stuff like retrieving current artist, track, and so on...
So when the status bar is clicked I check

if([iTunes isRunning]){
    NSLog(@"do my stuff...");
}

And it works very nice, but sometimes I get some issues when iTunes is launching or closing:

  1. If iTunes is launching (icon bouncing on the dock) and I click on the Status Bar icon of my App the "rainbow loading circle" (or beachball) appears when my mouse hovers the status bar icon and my App just freezes. When iTunes finishes launching and shows up my library window my Application continues its work without a problem. This is not a big concern because the app continues to work, even though it freezes when iTunes is launching.
  2. When iTunes is closing, and if I click on the status bar icon fast (before iTunes completely shuts down) enough, 2 things can happen: 1- iTunes will reopen, even though I chose to close it, and 2- iTunes is closed successfully but my app will freeze forever, the "rainbow loading circle" appears when my mouse hovers the status bar icon. Even if I try to open iTunes again, my app will stay that way. I have to go to Activity Monitor to stop the process.

Any ideas on how to fix some of these issues?
Thank you!

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
Pedro Vieira
  • 3,330
  • 3
  • 41
  • 76
  • The `"rainbow loading circle"` is typically called a beachball. It also used to be called the SPOD (Spinning Pizza of Death) although I haven't heard that term in years. – Lily Ballard Jan 22 '13 at 00:18
  • You described the situation very well, it's exactly that way. –  Jan 22 '13 at 01:24
  • @PedroVieira Do you already use techniques like NSNotificationCenter (to catch when iTunes launches and quits), NSRunningApplication (to catch if iTunes is running), ... ? –  Jan 22 '13 at 02:45
  • Yeah, I've used both but it's just the same thing. What I'd really like to have is a `NSWorkspaceWillTerminateApplicationNotification` but there isn't one. There's only the `NSWorkspaceDidTerminateApplicationNotification`. – Pedro Vieira Jan 22 '13 at 19:46
  • Luckily the described situation is very seldom and probably no one will run into it in a daily use of such a tool. No need to quit iTunes and hit fast the StatusBar Icon :) include an option to launch iTunes when your StatusBar-App launches and when an user likes and uses that, the launching problem is also taken care of (in daily use that is). –  Jan 22 '13 at 23:51
  • I assume you use also the iTunesNotification System. So the data your StatusBar Application has from iTunes, once it plays, is always up-to-date. No need to read anything from iTunes when a click in the StatusBar Icon happens. –  Jan 22 '13 at 23:58
  • Good point ;) yes, that's right. It's always up-to-date based on iTunes info. – Pedro Vieira Jan 23 '13 at 00:00

0 Answers0