Hi
Sorry - this is relatively basic, but I can't get it. I'm trying to display an NSAlert in my document based Mac Application. Unfortunately, I keep getting the error:
My code for displaying the NSAlert is:
and in the related header file, I have:
Does anybody know what is causing this? As I understand it, beginSheetModalForWindow:window, 'window' should be the name of the view that the alert should appear in. How would I find that? I have read that I should import foundation/foundation.h in my header, but this didn't make a difference.
Thanks in advanced,
Sam
Sorry - this is relatively basic, but I can't get it. I'm trying to display an NSAlert in my document based Mac Application. Unfortunately, I keep getting the error:
Code:
Use of undeclared identifier 'window'; did you mean '_windows'?
Code:
- (void)showNewUserMessage {
NSAlert *alert = [[NSAlert alloc] init];
[alert setAlertStyle:NSInformationalAlertStyle];
[alert setMessageText:@"IMPORTANT INFORMATION"];
[alert setInformativeText:@"TEXT"];
[alert beginSheetModalForWindow:window modalDelegate:self];
}
and in the related header file, I have:
Code:
#import <Cocoa/Cocoa.h>
#import <WebKit/WebView.h>
- (void)showNewUserMessage;
Does anybody know what is causing this? As I understand it, beginSheetModalForWindow:window, 'window' should be the name of the view that the alert should appear in. How would I find that? I have read that I should import foundation/foundation.h in my header, but this didn't make a difference.
Thanks in advanced,
Sam