SO originally I was having some trouble with Swift 2 closures, here was my problem:
func getImgurHotListWithViralBool(viral:Bool) -> NSArray
{
IMGGalleryRequest.hotGalleryPage(0, withViralSort: viral,
success:{
(objects:NSArray) in
//It gives the error here*********
},
failure: {(error:NSError) in
})
}
It gives the error:
Cannot convert value of type '(NSArray) -> ()' to expected argument type '(([AnyObject]!) -> Void)!'
UPDATE: Thankfully, Marco Boschi helped me with this solution;
func getImgurHotListWithViralBool(viral:Bool) -> NSArray {
IMGGalleryRequest.hotGalleryPage(0, withViralSort: viral,
success: { (objects: [AnyObject]!) in
// ...
}, failure: { (error:NSError) in
// ...
})
}
And now the error is present in error:NSError i.e :
Cannot convert value of type '(NSError) -> ()' to expected argument type '(([AnyObject]!) -> Void)!'
What should I do?
success:{ objects in /* ... */ }. And please post your code and the exact error message, not a screenshot of both. - luk2302