I've an objective-c function that looks like below
+ (void) invokeSortingWithClassName: (NSString*) className functionName: (NSString*) functionName closure: (id(^)(NSArray* arr))closure;
and I've to call this method from a swift class. The swift code that calls this method looks like below
SortHandler.invokeSorting(withClassName: className, functionName: functionName, closure:
{
args in
let something = unwrap(args!)
do
{
let returnValue = try closure(something as NSArray!) //this is another closure coming as a parameter in the function in which this code is written and this throws
return returnValue;
}
catch
{
throw error
}
return "-1" as! T
})
At the start of closure definition, I get this attached error
Essentially, this closure throws an error and I am not sure, how to handle this error in objective-c definition of this function. Please help me fix this error