swift3 报错 unrecognized selector sent to instance
2017-02-10
最新回答 / Florianus
加了一个 Outlet 如果要删除,不能只在 ViewController 中删除,还要在右边面板的 Connections Inspector 中删除关联。
2017-02-09
//计算年龄的方法
let now = Date()
let calendar = Calendar(identifier: .gregorian)
let nowYear = calendar.component(.year, from: now)
let birthdayYear = calendar.component(.year, from: birthday.date)
let age = nowYear - birthdayYear
let now = Date()
let calendar = Calendar(identifier: .gregorian)
let nowYear = calendar.component(.year, from: now)
let birthdayYear = calendar.component(.year, from: birthday.date)
let age = nowYear - birthdayYear
2017-01-14
let age = now! - year!
let hasPropertyText = hasProperty.on ? "有房" : "无房"
result.text = "\(name.text), \(age)岁,\(genderText),身高\(height.text!),\(hasPropertyText)"
let hasPropertyText = hasProperty.on ? "有房" : "无房"
result.text = "\(name.text), \(age)岁,\(genderText),身高\(height.text!),\(hasPropertyText)"
2016-12-22
let dateFormatter = NSDateFormatter()
dateFormatter.dateFormat = "yyyy"
let year = dateFormatter.stringFromDate(birthday.date).toInt()
let now = dateFormatter.stringFromDate(NSDate()).toInt()
dateFormatter.dateFormat = "yyyy"
let year = dateFormatter.stringFromDate(birthday.date).toInt()
let now = dateFormatter.stringFromDate(NSDate()).toInt()
2016-12-22
最新回答 / zkxlovewqlforever
“name.delegate = self”报错可能是因为你的Controller还没有遵循UITextFieldDelegate协议
2016-12-07