I add a label to the View Controller and this compiles / runs / shows fine.
I then drag in a WebView into the View Controller but get this message when I run the
application:
4 Answers
Well first of all you need to define the Web view so it actually knows what todo all it is doing
right now is trying to find what to run here, see a tutorial on youtube or such, this is the code i
used for mine, just to set it up. first you want to put the web view into the view controller and
add a toolbar to the bottom of it. add four bar button items onto the bar. and put a fixed space
in-between the two.
then you need to set the styles of them do this by going to attributes inspector> button type >
choose style choose the following for the button 1st one is rewind 2nd is forward 3rd one is
refresh last one is Cancel.
then control click and drag the button to the web view it will give you the options for it like load
rewind and refresh.
then go to your storyboard and make sure you have you main and header files connected do
this by selected the view controller in the storyboard files, then change the class to the view
controller you want to hook up to. then hit enter
then what you need to do is go to your main file(.m) and insert the following code like this
@interface WebViewController ()
@end
@implementation WebViewController
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
//custom initialization
}
return self;
}
- (void)viewDidLoad {
accept obviously you need to replace the void or just past into the right places Then build and
Run your code use iOS simulator iPhone 6.
judging on the error text this is Mac App, not iOS (there is NSWindow) Eugene Braginets Dec 17 '15 at
11:16