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

The Archive Base Latest Questions

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

I have found some code for my infoButton which shows up my new credits.xib

  • 0

I have found some code for my infoButton which shows up my new credits.xib but I can’t manage to come back to my RootViewController.
On my Credits.xib, I have linked my “Done” button with ToucheDown-FirstResponder-ToggleCredits Close.

Here is my code for the infoButton in my RootViewController.m in ViewDidLoad

UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight];
[button addTarget:self action:@selector(toggleCreditsOpen:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *modalButton = [[UIBarButtonItem alloc] initWithCustomView:button];
[self.navigationItem setRightBarButtonItem:modalButton animated:YES];
//[button release];
[modalButton release];

and my code just after my ViewDidLoad

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


- (IBAction) toggleCreditsClosed:(id)inSender
{
    NSLog(@"Button Pressed!");
    //[self.navigationController dismissModalViewControllerAnimated:YES];
    [self.parentViewController dismissModalViewControllerAnimated:YES];
}

I think I am missing something should I create a Credits.h and put the toggleCreditsClosed in it ?

Here is the stack trace

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7c67610> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key DoneButton.'
*** First throw call stack:

Here is my Credits.h

#import <UIKit/UIKit.h>


@interface Credits : UIViewController

{

    IBOutlet UIButton *DoneButton;


}

@property (nonatomic, retain) UIButton *DoneButton;

@end

and my Credits.m

#import "Credits.h"



@implementation Credits


@synthesize DoneButton;

- (void)viewDidLoad
{
    [super viewDidLoad];

}

- (void)viewDidUnload
{
    }



- (IBAction) toggleCreditsClosed:(id)inSender
{
    NSLog(@"Button Pressed!");
    [self dismissModalViewControllerAnimated:YES];
}


@end

If a delete the DoneButton link, the Credits view shows up but I it’s when I press the Done button that I have a problem

Costumes[402:11f03] -[UIViewController toggleCreditsClosed:]: unrecognized selector sent to instance 0x7a4c460
2012-10-24 22:19:33.271 Costumes[402:11f03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController toggleCreditsClosed:]:

Sorry but I don’t understand what I have to do and I cannot upload an image to show you but
in Outlets the link is (view<->View) and in Received Actions (toggleCreditsClosed:<->Button-Done Touch Down)

  • 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-13T06:44:13+00:00Added an answer on June 13, 2026 at 6:44 am

    Welcome on SO !

    Yes, you should create a separate .h / .m for your Credits. Then tell Inteface Builder that your .xib is a Credits class. Then link your button to this .h with the action you want. Basically, your last method should be in Credits.m :

    - (IBAction) toggleCreditsClosed:(id)inSender
    {
        NSLog(@"Button Pressed!");
        [self dismissModalViewControllerAnimated:YES];
    }
    

    Watch out, you dismiss the modal view with self instead of self.parentViewController in your code !

    (PS : answers you’ll get may not always work. Don’t hesitate to comment, telling us what (didn’t) work !)

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

Sidebar

Related Questions

I have found some code which recognize circles in particular image and I was
I have found some code snippet in the internet. But it is missing some
I have looked around and found some code which so called chooses an image
I have found some code in grails plugins that can be use outside grails.
I have found some code that I need to use for my application but
I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does
I am now trying to understand some code and I have found a pattern,
I have adapted some code from a great article I found about circle drawing
I have found some jQuery codes for show content with slide effect, but none
I have found some similar Que's on SO but had not find the solution.

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.