将加载gif添加到NSAlert

时间:2015-10-08 17:44:55

标签: objective-c macos nsprogressindicator nsalert

我想在我的NSAlert中添加一个加载gif我试过这个但是它似乎不起作用:

NSProgressIndicator * gif;
gif.style = NSProgressIndicatorSpinningStyle;
[gif startAnimation:self];

NSAlert *alert = [[NSAlert alloc] init];
[alert setInformativeText:@"Please check your internet connection and try again."];
[alert setMessageText:@"Connection Error"];
[alert setAlertStyle:NSWarningAlertStyle];
[alert setAccessoryView:gif];
[alert runModal];

任何想法我做错了什么?

0 个答案:

没有答案
相关问题