Im trying to
[webLoad loadRequest:[NSURLRequest requestWithURL:url]];
in a ViewController when clicked from AnotherViewController's
- (IBAction)actionClick:(id)sender { }
navigation icon.
i used below code, but its not working
=========================AnotherViewController============================
- (IBAction)actionClick:(id)sender {
[[NSNotificationCenter defaultCenter] postNotificationName:@"Notification" object:self];
[self performSegueWithIdentifier:@"toURL" sender:self];
}
=============================ViewController============================
- (void)viewDidLoad {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(Notification:)
name:@"Notification"
object:nil];
}
- (void) Notification:(NSNotification *) notification
{
progressBar.progress = 0;
progressBar.hidden = false;
NSString *urlString = [[NSUserDefaults standardUserDefaults]stringForKey:@"urlSearch"];
urlString = [urlString stringByAddingPercentEscapesUsingEncoding:NSISOLatin1StringEncoding];
NSURL *url = [NSURL URLWithString:urlString];
[webLoad loadRequest:[NSURLRequest requestWithURL:url]];
}