AFNetworking을 사용하여 날씨 정보 양식 openweathermap API를 검색하고 있습니다. responseObject.description
에서 강조AFNetworking을 사용할 때 'Any 객체'가 'NSProxy'의 하위 유형이 아닙니다.
let manager = AFHTTPSessionManager()
manager.requestSerializer = AFJSONRequestSerializer()
let url = "http://api.openweathermap.org/data/2.5/weather"
let params = ["lat": latitude,"lon": longitude,"cnt": 0]
manager.get(url, parameters: params,
success: {(operation: URLSessionDataTask,responseObject: AnyObject!) in print("JSON" + responseObject.description!) },
failure: {(operation: URLSessionDataTask?,error: Error) in print(error.localizedDescription)}
)
는 오류가 사라집니다 .description
을 제거하면 'Anyobject가'NSProxy ' 의 서브 타입이 아니라고 지적했다. 플랫폼 : 엑스 코드 8.3.2 SWIFT : 3
'Anyobject' is not a subtype of 'NSProxy'