tags:

views:

270

answers:

3

How can we bounce the dock icon of our application?

+7  A: 

You can use the requestUserAttention: from NSApplication. The NSRequestUserAttentionType allows you to specify whether the Dock icon will bounce once or until the application is activated.

Laurent Etiemble
A: 

Hi

I tried

[NSApp activateIgnoringOtherApps:YES]; 
int attentionrequest = [NSApp requestUserAttention:NSCriticalRequest]; 

and also this

[NSApp requestUserAttention:NSCriticalRequest]; 

but not works

Amit Battan
This works only if the application IS NOT activated.
Laurent Etiemble
A: 

Hi All

sorry it works... my focus was on my application when I test it... Its works when my focus is not on application

[NSApp requestUserAttention:NSCriticalRequest];

Is any way to bounce the icon even focus on application...

Amit Battan
I think you don't have to request user attention if your application is active as the user is, well, using your application.Maybe you should consider using the Growl framework to display visual notifications.
Laurent Etiemble