I'm trying some stuff, to test the status bar icon feature.
I think I got the all the functions right. However when run. The icon displayed for about 1 mili second then disappeared.
Below is the screenshot of my code:
source code: https://www.dropbox.com/sh/drdxi2zgumc4c3l/s-4J1S418s
Demo video: https://dl.dropbox.com/u/8032222/the%20app%20run%20weird.mov
Retain statusItem object.
statusItem=[[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]retain];
From Documentation of
The receiver does not retain a reference to the status item, so you need to retain it. Otherwise, the object is removed from the status bar when it is deallocated.