tristanhimmelman/AlamofireObjectMapper

responseArray build error

Closed this issue · 5 comments

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

Did you import AlamofireObjectMapper at the beginning of your file?

Yes,

import Alamofire
import ObjectMapper
import AlamofireObjectMapper

these all imported.

Can you post CouponResponse please

Ohh my God!
Sooo sorry! I forgot to put :Mappable for my class.

Thx, solved! :)

hehe no problem 👍