开发者

Cocoa How to display Informative Message

开发者 https://www.devze.com 2023-03-16 12:24 出处:网络
I need to display informative mess开发者_JAVA百科age box in Cocoa Application, which control should i use,

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.

Cocoa How to display Informative Message

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,
}
0

精彩评论

暂无评论...
验证码 换一张
取 消