0
我期待更新此代碼爲10.8至10.11。這是原始代碼。NSAlert在XCode 7
NSAlert *alertSheet = [NSAlert alertWithMessageText:@"Message Text." defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"Informative text PJ%@-%@ with more text.", self.projectNumber,self.projectName];
[alertSheet setAlertStyle:NSCriticalAlertStyle];
[alertSheet beginSheetModalForWindow:self.window modalDelegate:nil didEndSelector:nil contextInfo:nil];
某些代碼已棄用。這是我迄今爲止所做的,但它不起作用。
NSAlert *alertSheet = [[NSAlert alloc]init];
[alertSheet setMessageText:@"Message Text."];
[alertSheet setInformativeText:@"Informative text PJ%@-%@ with more text.", self.projectNumber,self.projectName];
[alertSheet beginSheetModalForWindow:self.windowPreferences completionHandler:nil];