Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8652065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:13:14+00:00 2026-06-12T14:13:14+00:00

In a NavigationController I have an TabBarController. I have a custom class for TabBarController’s

  • 0

In a NavigationController I have an TabBarController. I have a custom class for TabBarController’s NavigationItem, which is subclass of UINavigationItem. My NavigationItem has a TabBarButtonItem which contains an UIButton. I have defined an action for this button. My question is how can I programmatically make a push to an other view from this action? How can I get in this class the navigation controller? Or exists an other way for this?

in .h:

@interface CustomNavigationItem : UINavigationItem
{
    IBOutlet UIBarButtonItem *barbtnApply;
    IBOutlet UIButton *btnApply;
}
@property(nonatomic,retain) UIBarButtonItem *barbtnApply;
@property(nonatomic,retain) UIButton *btnApply;
-(IBAction)actionApply:(id)sender;

@end

in .m:

@implementation CustomNavigationItem

@synthesize btnApply = _btnApply;
@synthesize barbtnApply = _barbtnApply;

-(IBAction)actionApply:(id)sender
{
    btnApply = sender;
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"test" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    //push to other view
}
@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:13:15+00:00Added an answer on June 12, 2026 at 2:13 pm

    Maybe you should declare a delegate and call it on the button method.

    in your CustomNavigationItem.h

    @protocol CustomNavigationItemDelegate <NSObject>
    
    -(void)shouldPushViewController;
    
    @end
    
    @interface CustomNavigationItem : UINavigationItem{
          id<CustomNavigationItemDelegate> delegate;
    }
    
    @property (nonatomic, assign) id<CustomNavigationItemDelegate> delegate;
    

    in your CustomNavigationItem.m

    @implementation CustomNavigationItem
    
    @synthesize btnApply = _btnApply;
    @synthesize barbtnApply = _barbtnApply;
    @synthesize delegate;
    
     -(IBAction)actionApply:(id)sender
     {
         btnApply = sender;
         [self.delegate shouldPushViewController];
    }
    @end
    

    in your viewcontroller.m

    set the delegate

    in .h

    @interface MyViewController:UIViewController <CustomNavigationItemDelegate>
    

    in .m

     mynavigationItem.delegate = self;
    

    and implement the method

    -(void)shouldPushViewController{
        [self.navigationController pushViewController:viewControllerToPass animated:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tabbarcontroller, in one tab it has a navigationcontroller with tableview controller.And
I have created a project which consist of a tabbarcontroller and a navigationcontroller .
I have UITabbarMoreController which contains a few UINavigationControllers. These UINavigationControllers then contain my custom
I have an iPhone app which has a tabBarController as the root view controller
I am using a view Controller which have contains tabbarcontroller(4 tabs). each tabbar have
I have a view inside a tabbarcontroller and navigationcontroller and my 'willAnimateRotationToInterfaceOrientation' method is
i have a uitabbarcontroller which has 3 items. each item has its own navigation
I have a tab controller, which contains a navigation controller which again contains a
I have a tabbarcontroller that is pushed onto a navigationController. I tried to change
In my app I have a tabBarController and in it a navigationController. One of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.