I need to display informative mess开发者_JAVA百科age box in Cocoa Application, which control should i use, i read the document of NSAlert, but it seems, it will create the modal message box, where i need something, where i will just show a popup for fraction of seconds and will get destroyed after some time by it self.
Sounds like a job for Growl.
It's a third-party software product, for which we provide a framework you can include in your application. See also the application-developer page.
you could use the NSTimer
for auto dismiss.
[self showMyMessage];//put your code in showMyMessage method to show your alert,
NSTimer* myTimer = [NSTimer scheduledTimerWithTimeInterval:60.0 target:self
selector:@selector(callToDismissAlert:) userInfo:nil repeats:NO];
After 60.0 second , iOS will call the below function
-(void) callToDismissAlert:(NSTimer*) t
{
[self dismissMyAlert];// put your code in dismissMyAlert method to dismiss your alert,
}
精彩评论