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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:17:35+00:00 2026-05-23T06:17:35+00:00

I’m new to ios development and to stackoverflow. I did try searching both stackoverflow

  • 0

I’m new to ios development and to stackoverflow. I did try searching both stackoverflow and google before posting.

I built a simple little app, originally just left it an iphone only app, but decided to make it universal in the end. I, stupidly, was messing around when i was getting to know xcode 4 and switched it to universal and then back again so i had to recopy the project and do it again. This time i started it with a universal app. (Not when i created it but after i went to project and selected it there) It created the ipad folder and mainwindow-ipad.xib file but was empty of course since i didn’t do anything yet. I had it set up as a tabbed based app so my iphone version had firstview and secondview nib files also, but the ipad version didn’t. I set it all up in iphone version first and it worked fine. I then went and laid down the ipad version (i did eliminate the second tab from mainwindow-ipad because i didn’t need it)

i then went and created a new nib file and placed it in the ipad folder along with “main-ipad.h” and “main-ipad.m”. I copied my code and connected everything and it runs fine on ipad simulator but now when i try and run iphone simulator i get “SIGABRT error. I took a screen shot of it. I don’t fully understand objective-c so i was hoping someone can help me? I can post any code or whatever you might need to help me with this error so just ask.

Appreciate any help and suggestions you may have!

Thanks!

[Okay i would have posted image but I can’t since I’m a new user, instead i posted the line highlighted and the output from xcode]

Code for file with error:

int main(int argc, char *argv[])
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    int retVal = UIApplicationMain(argc, argv, nil, nil); //ERROR IS ON THIS LINE <-----
    [pool release];
    return retVal;
}

[OUTPUT]

2011-06-18 17:32:43.980 Price Assist[445:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x4e09cc0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key finallabel.'
*** Call stack at first throw:
(
0   CoreFoundation                      0x00dc35a9 __exceptionPreprocess + 185
1   libobjc.A.dylib                     0x00f17313 objc_exception_throw + 44
2   CoreFoundation                      0x00dc34e1 -[NSException raise] + 17
3   Foundation                          0x00795677 _NSSetUsingKeyValueSetter + 135
4   Foundation                          0x007955e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5   UIKit                               0x0021130c -[UIRuntimeOutletConnection connect] + 112
6   CoreFoundation                      0x00d398cf -[NSArray makeObjectsPerformSelector:] + 239
7   UIKit                               0x0020fd23 -[UINib instantiateWithOwner:options:] + 1041
8   UIKit                               0x00211ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9   UIKit                               0x000c7628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10  UIKit                               0x000c5134 -[UIViewController loadView] + 120
11  UIKit                               0x000c500e -[UIViewController view] + 56
12  UIKit                               0x00038d42 -[UIWindow addRootViewControllerViewIfPossible] + 51
13  Foundation                          0x007955e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
14  UIKit                               0x00048ff6 -[UIView(CALayerDelegate) setValue:forKey:] + 173
15  UIKit                               0x0021130c -[UIRuntimeOutletConnection connect] + 112
16  CoreFoundation                      0x00d398cf -[NSArray makeObjectsPerformSelector:] + 239
17  UIKit                               0x0020fd23 -[UINib instantiateWithOwner:options:] + 1041
18  UIKit                               0x00211ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
19  UIKit                               0x0001717a -[UIApplication _loadMainNibFile] + 172
20  UIKit                               0x00017cf4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
21  UIKit                               0x00022617 -[UIApplication handleEvent:withNewEvent:] + 1533
22  UIKit                               0x0001aabf -[UIApplication sendEvent:] + 71
23  UIKit                               0x0001ff2e _UIApplicationHandleEvent + 7576
24  GraphicsServices                    0x00ffc992 PurpleEventCallback + 1550
25  CoreFoundation                      0x00da4944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
26  CoreFoundation                      0x00d04cf7 __CFRunLoopDoSource1 + 215
27  CoreFoundation                      0x00d01f83 __CFRunLoopRun + 979
28  CoreFoundation                      0x00d01840 CFRunLoopRunSpecific + 208
29  CoreFoundation                      0x00d01761 CFRunLoopRunInMode + 97
30  UIKit                               0x000177d2 -[UIApplication _run] + 623
31  UIKit                               0x00023c93 UIApplicationMain + 1160
32  Price Assist                        0x000029a9 main + 121
33  Price Assist                        0x00002925 start + 53
)
terminate called after throwing an instance of 'NSException'

iPhone FirstView nib file .h code:

@interface FirstViewController : UIViewController {
    IBOutlet UITextField *dollarinput;
    IBOutlet UITextField *centsinput;
    IBOutlet UIButton *combinevalue;
    IBOutlet UITextField *percentoffinput;
    IBOutlet UILabel *discountlabel;
    IBOutlet UILabel *finallabel;
}  
- (IBAction)calculate:(id)sender;
- (IBAction)backgroundTouched:(id)sender;
- (IBAction)autonext:(id)sender;

iPhone FirstView nib file .m code:

//
//  FirstViewController.m
//  Price Assist
//
//  Created by Dustin Schreiber on 6/15/11.
//  Copyright 2011 TheTechSphere.com. All rights reserved.
//

#import "FirstViewController.h"


@implementation FirstViewController

/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
[super viewDidLoad];
}
*/

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


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


- (void)viewDidUnload
{    
[percentoffinput release];
percentoffinput = nil;
[discountlabel release];
discountlabel = nil;
[finallabel release];
finallabel = nil;
[super viewDidUnload];

// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}


- (void)dealloc
{
[percentoffinput release];
[discountlabel release];
[finallabel release];
[super dealloc];
}


- (IBAction)calculate:(id)sender {
if ([centsinput.text length] == 0){
    centsinput.text = @"00";
}
if ([dollarinput.text length] == 0){
    dollarinput.text = @"00";
}
if ([percentoffinput.text length] == 0){
    percentoffinput.text = @"00";
}
double cDollars = [dollarinput.text doubleValue];
double cCents = [centsinput.text doubleValue];
double percentoff = [percentoffinput.text doubleValue] / 100;
NSString *ccDollars = [[NSNumber numberWithFloat:cDollars] stringValue];
NSString *ccCents = [[NSNumber numberWithFloat:cCents] stringValue];
NSString *placeholder = [NSString stringWithFormat:@"%@.%@", ccDollars, ccCents];
double combined = [placeholder doubleValue];
double discount = combined * percentoff;
NSString *discountholder2 =[NSString stringWithFormat:@"%.2f", discount];
discountlabel.text = discountholder2;
double newprice = (combined - discount);
NSString *str = [NSString stringWithFormat:@"%.2f", newprice];
finallabel.text = str;
dollarinput.text = ccDollars;
centsinput.text = ccCents;
percentoffinput.text = [[NSNumber numberWithFloat:percentoff] stringValue];
}

-(IBAction)backgroundTouched:(id)sender
{
[dollarinput resignFirstResponder];
[centsinput resignFirstResponder];
[percentoffinput resignFirstResponder];
}

- (IBAction)autonext:(id)sender {
if ([centsinput.text length ] >= 2) {
    if ([centsinput.text length] > 2) {
        centsinput.text = @"";
    } else {
        //next field
    }
}
}

@end

Thanks again! If anyone has any suggestions for my code i’d love to here them! Like I said, I’m new to it and thats the only way i know to do this.

————> If anyone wants, I’ll upload the entire project folder. Just ask. Thank you guys for all the help. i’m a n00b with xcode so i haven’t got it all down yet.

Project Zipped

  • 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-23T06:17:36+00:00Added an answer on May 23, 2026 at 6:17 am

    Post some code where you use finallabel and try to debug your app so you can tell me the line just before the app crashes.

    Option 2:
    Try to set a BreakPoint in malloc_error_break so we can have more info about the error.

    In XCode go to Run -> Show -> BreakPoints (or just cmd + option + B). Then double click to add a new symbol (symbolic breakpoint) and type in malloc_error_break then press enter.

    Now run your app and paste your console text.

    UPDATE If you need help http://developer.apple.com/library/mac/#recipes/xcode_help-breakpoint_navigator/articles/adding_a_symbolic_breakpoint.html


    Check your connections inside your InterfaceBuilder, you may have it wrong with fianllabel.
    Also check your Custom Class -> Class in your iphone XIB in your InterfaseBuilder


    UPDATE

    Go to Product -> Clean. Then Run.

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

Sidebar

Related Questions

public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I need to clean up various Word 'smart' characters in user input, including but
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the

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.