- macOS 开发 报 Failed to set (conten
- [MacOS安装homebrew报错:curl: (7) Fai
- SwiftUI 遇到Failed to build Conten
- macOS Big Sur 启动 MAT 报 Failed to
- RPC failed; curl 56 LibreSSL SSL
- 2020-03-25 CentOS Failed to set
- missing xcrun
- Mac M1 Pro rbenv build failures
- this class is not key value codi
- this class is not key value cod
viewcontroller 初始化不同
IOS alloc init 会自动创建空view
mac alloc init不会主动创建,需重写-(void)loadview方法,否则会报nib找不到的错误:
Failed to set (contentViewController) user defined inspected property on (NSWindow): -[NSNib _initWithNibNamed:bundle:options:] could not load the nibName: HWVC1 in bundle (null).
解决:需重写-(void)loadview方法
-(void)loadView
{
NSRect frame=[[[NSApplication sharedApplication]mainWindow]frame];
self.view=[[NSView alloc]initWithFrame:frame];
}
网友评论