我无法弄清楚为什么我不断收到此错误。每当我按下我的应用程序中的按钮时,整个事情都会崩溃。这是代码:
#import "additionViewController.h"
@interface additionViewController (){
}
@end
@implementation additionViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)getValue: (id)sender {
self.numberOne = (NSNumber *)self.firstNum.text;
self.numberTwo = (NSNumber *)self.secondNum.text;
self.fnumberOne = [self.numberOne floatValue];
self.fnumberTwo = [self.numberTwo floatValue];
self.finalValue = [NSNumber numberWithFloat:(self.fnumberOne + self.fnumberTwo)];
self.sum.text = (NSString *)self.finalValue;
}
@end
这是我尝试自己制作的第一个 iOS 应用程序。这很简单。不去 App Store 或任何东西。