Can't show a keyboard on UIWebView on new proj

2019-08-16 00:39发布

I have just created a new Single View Application on xCode 4.4. And it was created with .storyboards files (instead xib). Then I have added a UIWebView. And now I can't show a keyboard by the code line:

[self.window MakeKeyAndVisible];

Because there is no any window on ViewController.m. How to force showing a keyboard on UIWebView on this new xCode project template?

Thanks a lot for the help!

1条回答
淡お忘
2楼-- · 2019-08-16 00:47

You can always get the window property from the UIApplicationDelegate object. Since this is a singleton object, you can use:

[[UIApplication sharedApplication] delegate];

There you can reach the window property.

查看更多
登录 后发表回答