변환 오류에 대해 다소 혼란 스럽습니다. Xcode 8.0 및 Swift 3.0 변환 : 특정 변환 오류에 대한 설명을 찾고
은 내가 먼저 내가 스위프트 3.0 캐스트에Type(value)
지금은 금지 된 생각에서 스위프트 3.0
func updateCelsiusLabel() {
if let value = celsiusValue {
//This was the original code (that worked but is) failing after migration
//due to: Argument labels do not match any available overloads
celsiusLabel.text = numberFormatter.string(from: NSNumber(value))
//This is my code trying to fix this issue and the project is now compiling
//and everything is fine
celsiusLabel.text = numberFormatter.string(from: value as NSNumber)
}
else { celsiusLabel.text = "???"
}
}
에 스위프트 2.3 내 프로젝트 양식을 마이그레이션,하지만 난 확인하고 나는 전혀 컴파일러 경고를 얻을. 누군가 NSNumber(value)
의 문제가 무엇인지 말해 줄 수 있습니까?
내가 이해하는 한 value as NSNumber
과 NSNumber(value)
은 같은 것이어야합니다.
Ok, 그것은 사과로부터의 이상한 탈퇴의 종류 다. 그러나 나는 지금 그것을 얻는다. – Ruvi