PushViewController does not work with TabbarController

I have a tablet control panel app that uses a storyboard. Each tab has a UIWebview. I want to capture the link when the user clicks the link in Webview, if the link is an external link (if this is not my site). I want to open a link in another UIViewControl. (e.g. iphone popupi twitter app for iphone)

Right now; I got this code to capture the link (if the link is bing.com, then it should open it with another view controller), but I cannot open another UIViewController (in this case, PopViewController). This gives me this error:

No visible @interface for 'GundemViewController' declares selector 'pushViewController: animated:

- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {

//CAPTURE USER LINK-CLICK.

NSURL *url = [request URL];

NSString *urlString = [url absoluteString];

/******
 UIWebViewNavigationTypeLinkClicked: When user click on a link in the app it senses the action
 */

if (navigationType == UIWebViewNavigationTypeLinkClicked) {
    if ([urlString hasPrefix:@"http://www.bing.com/"]) {

        PopViewController *popUpView = [[PopViewController alloc] initWithNibName:@"PopupViewController" bundle:nil];

        [self pushViewController:popUpView animated:YES];
        return NO;
    }
}


return YES;
}
+5
2

, :

UITabBarController
    Tab1 View Controller
    Tab2 View Controller
    Tab3 View Controller

UITabBarController
    Tab1 Navigation Controller
        Tab1 View Controller
    Tab2 Navigation Controller
        Tab2 View Controller
    Tab3 Navigation Controller
        Tab3 View Controller

.. -pushViewController:animated: .

, , , . , :

UIViewController *tab1Controller = [[MyViewController alloc] initWithNibNamed:@"MyViewController" bundle:nil];
UINavigationController *tab1Nav = [[UINavigationController alloc] initWithRootViewController:tab1Controller];

// etc

.

-pushViewController:animated: self self.navigationController.

:

,

[self presentViewController:popUpView 
                   animated:YES 
                 completion:nil];

. , ,

[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];

.

+10

GundemViewController? , self.navigationController UINavigationController. - , , self.navigationController.

+1

All Articles