一样的代码为什么回报错。。
let genderText = gender.selectedSegmentIndex==0 ? "高富帅": "白富美"
let hasPropertyText = hasProperty.on ? "有房": "没房"
// get the age
let gregorian = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)
let now = NSDate()
let components = gregorian?.components(NSCalendarUnit.YearCalendarUnit, fromDate: birthday.date, toDate: now, options: NSCalendarOptions(0))
let age = components?.year
result.text = "\(name.text), \(age!)岁, \(genderText), 身高\(height.text!), \(hasPropertyText), 求交往!"
在 let components = gregorian?.components(NSCalendarUnit.YearCalendarUnit, fromDate: birthday.date, toDate: now, options: NSCalendarOptions(0)) 这里 报错 extra argument "toDate" in call