一样的代码提示这个错误,求指教
func datafromstring(datastr:String) -> NSData? { let d = NSDateFormatter() d.dateFormat = "yyyy-MM-dd" let data = d.dateFromString(datastr) return data } Cannot convert return expression of type 'NSDate?' to return type 'NSData' 一样的代码提示这个错误,求指教