Support Topics Documentation Slack YouTube Blog

Contextual closure type '() -> Void' expects 0 arguments, but 1 was used in closure body


(Joan Martínez) #1

Hi,

In IOS, when I try to use the remove file statement:

backendless.fileService.remove(
“myfiles/myhelloworld-async.txt”,
response: { ( result: AnyObject!) -> () in
print(“File has been removed: result = (result)”)
},
error: { ( fault : Fault!) -> () in
print(“Server reported an error: (fault)”)
}
)

I immediatlely get the following compilation error message:

“Contextual closure type ‘() -> Void’ expects 0 arguments, but 1 was used in closure body”

What can I do to solve the error?

This same problem happens to me if I try to delete a geopoint:

backendless.geo.remove(geoPoint,
response: {
(result: Any?) -> Void in
print(“GeoPoint removed: (String(describing: result))”)
},
error: {
(fault: Fault?) -> Void in
print(“Server reported an error: (String(describing: fault))”)
})

Regards,


(Joan Martínez) #2

Hi,

More than a week ago I started this query and at the moment I have not received any comment about my need …

Regads,


(Olga Danylova) #3

Hello Joan,

The remove methods were updated to void type as it is done in the Android-SDK, so they don’t have any arguments in the closure body.

Sorry for inconvenience, we’ll fix documentation as soon as possible.

Regards, Olga