我正在尝试着做一个状态栏应用。
在AppDelegate
中追踪鼠标动作。然后让nib对应的ViewController来调用加载view的函数。
//AppDelegate.h
@property myViewController *viewController;
//AppDelegate.m
@synthesize viewController;
- (IBAction)clickPreferences:(id)sender {
[viewController showView:sender];
}
//myViewController.m
@property (strong) IBOutlet NSView *preferencesView;
-(void)showView:(id)sender{
self.view = self.preferencesView; //here preferencesView is an IBOutlet property
[self loadView];
}
错误信息:
-[myViewController loadView] loaded the "Preferences" nib but no view was set.
在Preferences.xib
中只有一个custom view。
我觉得应该不需要一个NSWindow
。请问加载一个view需要哪些条件?如何调用?
What the hell are you talking about? Is this really iOS?
NSView is an object of Cocoa. How can it be iOS
Is UIView good?