线程1:SIGABRT

时间:2015-01-19 14:22:52

标签: ios swift sigabrt

这是我的第一个问题(老实说,Xcode中的程序)如果我违反任何格式规则等等,请道歉!

我在创建区域计算器时遇到问题(以后在报价计算器中使用)并查看了我能找到的每个SIGABRT线程,但我无法解决它。

import UIKit
class ViewController: UIViewController{
@IBOutlet weak var forename: UITextField!
@IBOutlet weak var surname: UITextField!    
@IBOutlet weak var email: UITextField!    
@IBOutlet weak var widthInput: UITextField! 
@IBOutlet weak var lengthInput: UITextField!    
@IBOutlet weak var areaOutput: UILabel!    
@IBOutlet weak var perimeterOutput: UILabel!    
@IBOutlet weak var results: UILabel!

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

@IBAction func calculate(sender: AnyObject) {

    let width = NSString(string: widthInput.text).doubleValue
    let length = NSString(string: lengthInput.text).doubleValue

    // The calculation used to work out the area of a room
    var area = width * length
    areaOutput.text =  "\(area)"

    // The calculation used to work out the perimeter of a room
    var perimeter = 2 * (length + width)
    perimeterOutput.text =  "\(perimeter)"


}

任何帮助都将不胜感激。

谢谢, 马克

0 个答案:

没有答案