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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:22:15+00:00 2026-05-26T02:22:15+00:00

I am a very inexperienced developer and have run into a problem that should

  • 0

I am a very inexperienced developer and have run into a problem that should be easy however after hours of reading over Apple’s Developer guide and many different questions on this site I am still stumped.

All I am trying to do is transition from my root view controller to my next view controller via a UIButton.

Here is appdelegate.h:

#import <UIKit/UIKit.h>

@class MainViewController;

@interface MDAppDelegate : NSObject <UIApplicationDelegate> {

    UIWindow *window;
    UINavigationController *navigationController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;

@end

Important stuff from Appdelegate.m:

#import "MDAppDelegate.h"
#import "MainViewController.h"

@implementation MDAppDelegate


@synthesize window, navigationController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions  (NSDictionary *)launchOptions

{

    // Override point for customization after application launch.
    [window addSubview:navigationController.view];
    [self.window makeKeyAndVisible];
    return YES;
}

MainViewController.h:

#import <UIKit/UIKit.h>


@interface MainViewController : UIViewController {

UIButton *cityButton;

}

@property (nonatomic, retain) IBOutlet UIButton *cityButton;

- (IBAction)chooseCityAction:(id)sender;

@end

And finally, MainViewController.m:

#import "MainViewController.h"
#import "DailyDealViewController.h"


@implementation MainViewController
@synthesize cityButton;

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

    }

return self;

}

- (void)dealloc
{
    [cityButton release];

    [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.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.

    UIBarButtonItem *temporaryBarButtonItem = [[UIBarButtonItem alloc] init];
    temporaryBarButtonItem.title = @"Back";
self.navigationItem.backBarButtonItem = temporaryBarButtonItem;
[temporaryBarButtonItem release];


}

- (void)viewDidUnload
{
    [self setCityButton:nil];
    [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);
}

- (IBAction)chooseCityAction:(id)sender {

    DailyDealViewController *dailyDealViewController = [[DailyDealViewController alloc]initWithNibName:@"DailyDealViewController" bundle:nil];

    [dailyDealViewController release];

    [self.navigationController pushViewController:dailyDealViewController animated:YES];

}
@end

Here is the error:

2011-10-03 21:56:14.258 MD[4235:207] *** Terminating app due to uncaught exception
'NSUnknownKeyException', reason: '[<UIViewController 0x4b434c0>
setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key 
cityButton.'

I would love to know what I missing.

  • 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-26T02:22:15+00:00Added an answer on May 26, 2026 at 2:22 am

    You have released dailyDealViewController before pushing it. Move the release statement to after the pushViewController statement.

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

Sidebar

Related Questions

I am very inexperienced with SQL. I have a table that looks like this:
Very simply put: I have a class that consists mostly of static public members,
I am very new and very inexperienced. I have downloaded a WPF version of
Very simply put, I have the following code snippet: FILE* test = fopen(C:\\core.u, w);
Very odd problem as this is working perfectly on our old Classic ASP site.
Very inexperienced with Flash, but I hope this is simple enough for someone to
PREFACE: I'm relatively inexperienced in C++ so this very well could be a Day
I'm fairly inexperienced in SQL and this seems like it must be an easy
If I have a basic accessor method that returns an ArrayList What exactly would
I am, a beginner to databases, and am very inexperienced at programming generally. For

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.