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

  • Home
  • SEARCH
  • 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 1001771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:43:41+00:00 2026-05-16T07:43:41+00:00

I am writing my first iPhone App, a test case before I write my

  • 0

I am writing my first iPhone App, a test case before I write my life saving app to help me learn how things are done on this platform. So I used the standard ModelViewController widget and created my app. I put my UI on the default view and added all the glue code in the ViewController.m/.h files: event handlers, IBOutlet mappings to change my controls’ state, etc. This all worked wonderfully and didn’t take too long to do.

Now I want to add an info page to my application. I added an i button to my main page and mapped it to an empty handler, toggleCreditsOpen:, and then created a new view for my project, “info.xib”. I opened interface builder and set up my view to my liking (though I would prefer if the credits could be loaded dynamically rather than directly in the view, I’ll worry about that later as I’m pretty sure it’s easy to change the text, and I just hope it’s just as easy to load from a localized resource file, but that’s not my question). I created a Done button in my info.xib and mapped that to another handler, toggleCreditsClosed. So now I have these two empty handlers: one when the info button is pressed, and one when the done button in the info window is pressed:

- (IBAction) toggleCreditsOpen: (id) sender {
    // ???
}

- (IBAction) toggleCreditsClosed: (id) sender {
    // ???
}

If anyone can explain what goes in these two functions, I will not be the only one grateful since I will put these instructions in an upcoming blog entry explaining how to do this so that people don’t have to bash their heads against the table like me trying to put that final touch to their app: the credits!

  • 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-16T07:43:41+00:00Added an answer on May 16, 2026 at 7:43 am

    First, you should have a separate view controller class for the info view (best practice).
    And there are different answers to your question depending on how you want to present the info view.

    Assuming you have made another class for your info view controller, a standard way is to use presentModalViewController: animated:

    - (IBAction) toggleCreditsOpen: (id) sender {
        InfoViewController *info = [[InfoViewController alloc] initWithNibName:@"info" bundle:[NSBundle mainBundle]];
        [self presentModalViewController:info animated:YES];
        [info release];
    }
    

    Move the other method to your InfoViewController class:

    - (IBAction) toggleCreditsClosed: (id) sender {
        [self.parentViewController dismissModalViewControllerAnimated: YES];
    }
    

    So you will have to make two new files: InfoViewController.h, InfoViewController.m
    And you will have to set File’s Owner in your info.xib to be of class InfoViewController (it’s on the identity tab in inspector of File’s Owner) and set the view outlet and the button action there as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

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.