获取分段错误11错误。我已设法将其缩小到方法中的参数(尝试转换为Swift 3)。
func uploadUserAvatar(photo: UIImage?, reachingRate: ((_ rate: Double) -> Void)?, completion: ((_ status: ResponseStatus, _ JSON: AnyObject?) -> Void)?) {
//Some code
}
和
enum ResponseStatus {
/**
Successful request and the server gave a status of 'success'.
*/
case success
/**
The request was unsuccessful or the server did not give a status of 'success'.
*/
case failure
/**
Could not parse the JSON of the response.
*/
case invalidJSON
/**
The user's is not authorized.
*/
case unauthorized
/**
The request timed out.
*/
case timedOut
}
无法发现问题。有什么建议吗?