responseArray build error
Closed this issue · 5 comments
anilustel commented
I'm using request for "responseArray" but build failed with this error:
Cannot invoke 'responseArray' with an argument list of type '((Response<[CouponResponse], NSError>) -> Void)'
Code:
Alamofire.request(.GET, URL).responseArray { (response: Response<[CouponResponse], NSError>) -> Void in
if let couponRes = response.result.value {
print(couponRes[0].result)
}
}
How to solve this problem? Thx
tristanhimmelman commented
Did you import AlamofireObjectMapper
at the beginning of your file?
anilustel commented
Yes,
import Alamofire
import ObjectMapper
import AlamofireObjectMapper
these all imported.
tristanhimmelman commented
Can you post CouponResponse
please
anilustel commented
Ohh my God!
Sooo sorry! I forgot to put :Mappable for my class.
Thx, solved! :)
tristanhimmelman commented
hehe no problem 👍