i am newer to coding in general! I am trying to create a webview that doesnt allow navigation to viewers. I have most of the coding typed up, but i have two undeclared errors and i am not sure how to solve this issue.
What i am trying to do is create a webView, but i would like to make it where the viewer of the webView cant navigate to other pages. If he/she does attempt too it does not fulfill the request.So basically it stays specifically on one page.
If i just need declare them in a really simple way then please show me and help. Thank you.
The Errors are shown below:
#import "ViewController.h"
@interface ViewController()
<UIWebViewDelegate>
@end
@implementation ViewController
@synthesize webView;
- (void)viewDidLoad
{
[super viewDidLoad];
webview:delegate = nil;
NSURL *url = [NSURL URLWithString:@"https://twitter.com/u_bett"];
NSURLRequest *urlrequest = [NSURLRequest requestWithURL:url];
[webView loadRequest:urlrequest];
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
return NO;
}
Your method contains lot of issues:
Change that like:
And implement
shouldStartLoadWithRequest:
like:Check this tutorial for UIWebView implementation. I would like to suggest you to learn Objective C thoroughly before starting the development. (Some investment at this point will help you to save a lot of time in future)