Source Code : 
@interface Tray NSObject <NSApplicationDelegate> {
    
NSStatusItem *trayItem;
}
@
end

@implementation Tray

- (IBAction)testAction:(id)sender;
{
    
NSLog(@"Hello World");
}

- (
IBAction)quitAction:(id)sender;
{
    [
NSApp terminate:sender];
}

- (
void)applicationDidFinishLaunching:(NSNotification *)note;
{
    
NSZone *zone = [NSMenu menuZone];
    
NSMenu *menu = [[[NSMenu allocWithZone:zoneinitautorelease];
    
NSMenuItem *item;
    
    
item = [menu addItemWithTitle:@"Testing" action:@selector(testAction:) keyEquivalent:@""];
    [
item setTarget:self];
    
    
item = [menu addItemWithTitle:@"Quit" action:@selector(quitAction:) keyEquivalent:@""];
    [
item setTarget:self];
    
    
trayItem = [[[NSStatusBar systemStatusBarstatusItemWithLength:NSSquareStatusItemLengthretain];
    [
trayItem setMenu:menu];

[Login or Register to remove this advertisement]

    [
trayItem setHighlightMode:YES];
    [
trayItem setTitle:@"HERE"];
}

- (
void)dealloc;
{
    [
trayItem release];
    [
super dealloc];
}

@
end 
Xcode Reviewed by Xcode on . Adding to OS X Status Tray @interface Tray : NSObject <NSApplicationDelegate> { NSStatusItem *trayItem; } @end @implementation Tray - (IBAction)testAction:(id)sender; { NSLog(@"Hello World"); Rating: 5