Objective c 正在将加载gif添加到NSAlert
我想在我的NSAlert中添加一个加载gif,我已经尝试过了,但似乎不起作用:Objective c 正在将加载gif添加到NSAlert,objective-c,macos,nsprogressindicator,nsalert,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 an
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];
知道我做错了什么吗?进度指示器已声明但未初始化。
NSProgressIndicator*gif=[[NSProgressIndicator alloc]initWithFrame:NSMakeRect(0.0f,0.0f,20.0f,20.0f)]代码>?指定的初始值设定项是initWithFrame:
有什么问题吗。a) 它没有出现b)它没有动画更新您的问题