Xcode 4 et “SIGABRT d'erreur”? (uniquement pour les iphone)

Je suis nouveau sur le développement d'ios et de stackoverflow. Je n'ai essayez de faire une recherche à la fois stackoverflow et google avant de poster.

J'ai construit une simple petite application, à l'origine juste laissé un iphone seule application, mais a décidé de le rendre universel à la fin. Moi, bêtement, s'amusait quand j'ai été à savoir xcode 4 et commuté à l'universel, et puis de nouveau donc j'ai dû recopier le projet et de le faire à nouveau. Cette fois, je l'ai commencé avec une application universelle. (Pas quand je l'ai créé mais après je suis allé à projet et sélectionné), Il a créé l'ipad dossier et mainwindow-ipad.xib fichier, mais qui était vide, bien sûr, puisque je n'ai rien fait encore. Je l'avais mis en place comme l'un des onglets de base application pour mon iphone version avait firstview et secondview plume de fichiers, mais la version ipad n'a pas. Je l'ai mis tout dans l'iphone première version et il a bien fonctionné. Ensuite, je suis allé et a fixé la version ipad (je n'ai d'éliminer le deuxième onglet de mainwindow-ipad parce que je n'en avais pas besoin)

ensuite, je suis allé et a créé une nouvelle plume de fichiers et les placer dans l'ipad dossier, ainsi que la "main-ipad.h" et "main-ipad.m". J'ai copié mon code et connecté à tout, et ça fonctionne très bien sur ipad simulateur, mais maintenant, quand j'essaie de l'exécuter simulateur d'iphone, j'ai "SIGABRT erreur. J'ai pris une capture d'écran. Je ne comprends pas tout objective-c, donc j'espérais que quelqu'un peut m'aider? Je peux poster le code ou ce que vous pourriez avoir besoin pour m'aider avec cette erreur, il suffit de demander.

Apprécier toute l'aide et les suggestions que vous pourriez avoir!

Merci!

[Bon, je l'aurais posté l'image mais je ne peux pas car je suis un nouvel utilisateur, au lieu de cela, j'ai posté la ligne en surbrillance et la sortie à partir de xcode]

Code pour le fichier avec l'erreur:

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;
}

[SORTIE]

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 plume de fichier .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 plume de fichier .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

Merci encore! Si quelqu'un a des suggestions pour mon code, j'aimerais ici! Comme je l'ai dit, je suis nouveau et c'est le seul moyen que je connaisse pour ce faire.

------------> Si quelqu'un le veut, je vais télécharger l'intégralité du dossier de projet. Il suffit de demander. Merci les gars pour toute l'aide que. je suis un n00b avec xcode donc je n'ai pas tout encore.

Projet Zippée

Poster du code de l'endroit où vous utilisez finallabel et essayez de déboguer votre application de sorte que vous pouvez me dire la ligne juste avant l'application se bloque.
En ajoutant un point d'arrêt à [NSException soulever] et objc_exception_throw, vous aurez plus d'informations sur la raison de votre accident. Plus de détails ici : chanson.livejournal.com/171198.html
Merci! Code pour le fichier qui contient l'erreur. Je vais commenter à nouveau pour la prochaine partie de vos demandes

OriginalL'auteur ReArmedHalo | 2011-06-18