self.view = [[[NSBundle mainBundle] loadNibNamed:@"KeyboardView" owner:self options:nil] objectAtIndex:0];
self.inputView = (UIInputView*)self.view;上面的代码用于将Nib文件设置为Inputview,这是工作的,但下面的代码不工作...
NewViewController * myViewController = [[UIStoryboard storyboardWithName:@"Keyboard" bundle:nil] instantiateViewControllerWithIdentifier:@"NewView"];
self.view = myViewController.view;
self.inputView = (UIInputView*)self.view;发布于 2016-06-11 18:47:34
请检查故事板名称。是“键盘”或者别的什么。你写的包是nil,但它应该是[NSBundle mainBundle]。
NewViewController * myViewController = [[UIStoryboard storyboardWithName:@"Keyboard" bundle:nil] instantiateViewControllerWithIdentifier:@"NewView"];请检查以下内容:
NewViewController *vc =[[UIStoryboard storyboardWithName:@"MainStoryboard"
bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"NewView"];https://stackoverflow.com/questions/37762738
复制相似问题