0
votes

I'm using Alamofire, with ObjectMapper, things were so smooth before upgrading to Swift 2.0, now,

For the following signature:

public func responseArray<T: Mappable>(completionHandler: ([T]?, ErrorType?) -> Void) -> Self

I'm calling

 Alamofire.request(.GET, URL, parameters: nil)
            .responseArray { (response: [MyObject]?, error: NSError?) in

        }

and getting the following error:

Cannot invoke 'responseArray' with an argument list of type (([MyObject]?, NSError?) -> ())

Any help will be super appreciated.

1

1 Answers

0
votes

try this.

Alamofire.request(.GET, URL, parameters: nil)
    .responseArray { (response: [MyObject]?, error) in
        //your process
    }