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 4075808
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:20:43+00:00 2026-05-20T17:20:43+00:00

My Info button is showing up when I run my app but it doesn’t

  • 0

My Info button is showing up when I run my app but it doesn’t do anything, no response when I click it.

In my ProfileViewController file:

- (void)viewDidLoad
{
    UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeInfoDark];
    infoButton.frame = CGRectMake(290.0, 10.0, 15.0, 15.0);
    [infoButton addTarget:self action:@selector(toggleCreditsOpen:)forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:infoButton];

    [super viewDidLoad];
}

I also have the following two methods to load the about view (the screen that loads up when the button is clicked):

- (IBAction) toggleCreditsOpen:(id)inSender
{   
    UIViewController *theController = [[UIViewController alloc] initWithNibName:@"AboutViewController" bundle:nil];
    [self.navigationController presentModalViewController:theController animated:TRUE];
}

- (IBAction) toggleCreditsClosed:(id)inSender
{
    [self.navigationController dismissModalViewControllerAnimated:TRUE];
}

EDIT:
I am adding my full implementation file here:

#import "ProfileViewController.h"
#import "AboutViewController.h"

@implementation ProfileViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

- (IBAction)toggleCreditsOpen:(id)inSender
{   
    UIViewController *theController = [[UIViewController alloc] initWithNibName:@"AboutViewController" bundle:nil];
    [self.navigationController presentModalViewController:theController animated:YES];
}

- (IBAction)toggleCreditsClosed:(id)inSender
{
    [self.navigationController dismissModalViewControllerAnimated:TRUE];
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    UIButton *infoButton = [[UIButton buttonWithType:UIButtonTypeInfoDark] retain];
    infoButton.frame = CGRectMake(290.0, 10.0, 15.0, 15.0);
    //[infoButton addTarget:self action:@selector(toggleCreditsOpen:)forControlEvents:UIControlEventTouchUpInside];
    [infoButton addTarget:self action:@selector(toggleCreditsOpen:)forControlEvents:UIControlEventTouchDown];
    [self.view addSubview:infoButton];

    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@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-05-20T17:20:44+00:00Added an answer on May 20, 2026 at 5:20 pm

    Using your provided code works for me, if self.navigationController is non-nil, and there exists an AboutViewController.xib in your main bundle. Otherwise, I don’t see anything readily wrong.

    If you don’t have a navigation controller, the proper line in toggleCreditsOpen: would be:

    [self presentModalViewController:theController animated:YES];
    

    Edit:

    If you want to dismiss the modal view later, its usually a good idea to do this with a delegate. Instead of

    UIViewController *theController = [[UIViewController alloc] initWithWhatever];
    

    you can do

    AboutViewController *theController = [[AboutViewController alloc] initWithWhatever];
    

    where AboutViewController has a delegate. Probably something like id<DismissModalProtocol> delegate;. Then, your view controller would implement this @protocol, and before it calls presentModalViewController:animated:, it’ll set itself as the delegate. So very roughly, it would look something like this:

    // AboutViewController.h
    @protocol DismissModalProtocol;
    
    @interface AboutViewController : UIViewController {
      id<DismissModalProtocol> delegate;
    }
    @property id<DismissModalProtocol> delegate;
    @end
    
    @protocol DismissModalProtocol <NSObject>
    - (void)dismissController:(UIViewController *)viewController;
    @end
    
    
    // ProfileViewController.h
    #import "AboutViewController.h"
    
    @interface ProfileViewController : UIViewController <DismissModalProtocol>
    @end
    
    
    // ProfileViewController.m
    @implementation ProfileViewController
    - (void)dismissController:(UIViewController *)viewController {
      [self dismissModalViewControllerAnimated:YES];
    }
    
    - (void)toggleCreditsOpen:(id)sender {
      AboutViewController *controller = [[AboutViewController alloc] init];
      controller.delegate = self;
      [self presentModalViewController:controller animated:YES];
    }
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function: $(button.btn-info).click(function() { var id=this.id; }); So, and I have to
After I press a button, Android parse a JSON file and pick the info
I am showing a modal popup when someone click login button and then they
my code is showing all the addresses of shops.xml file. but i want to
I am trying to add an info button to my app to provide custom
I settings my info.plist as below: Initial interface orientation: Landscape (left home button) Supported
How can I create a person photo button like the one in contact info
<p>paragraph 1<span>extra info 1</span><span>extra info</span></p> <p>paragraph 2</p> <a> link </a> <button>accept</button> <p>another paragraph</p> Hi
I'd like to add a UINavigationController to my app info view (NOT to my
I have an 'info' button that does a modal flip to an info page.

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.