加载窗口的简单方法是按照以下步骤操作:-
#import <Cocoa/Cocoa.h>
#import "AOPAVIAWindowController.h"
@interface ARCAppDelegate : NSObject <NSApplicationDelegate>
{
NSWindowController *windowController;
}
-(IBAction)loadWindowNew:(id)sender;
@property(readwrite,strong)NSWindowController *windowController;
@end
#import "ARCAppDelegate.h"
@implementation ARCAppDelegate
@synthesize arcWindowController;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
}
-(IBAction)loadWindowNew:(id)sender
{
self.windowController=[[AOPAVIAWindowController alloc]init];
[self.windowController showWindow:self];
}
@end
现在在你的窗口控制器类中这样写: -
#import "AOPAVIAWindowController.h"
@implementation AOPAVIAWindowController
-(NSString *)windowNibName
{
return @"AOPAVIAWindowController";
}
@end