I’m probably doing something wrong, because this find doesn’t get any success or failure callback (even after 10 seconds):
func findUsersWithQuery(query: String,
atPage page : Int,
success : (items : [BackendlessUser]) -> Void,
failure : (() -> Void)? = nil) {
Types.tryblock({ () -> Void in
let queryOptions = QueryOptions()
queryOptions.relationsDepth = 0;
queryOptions.pageSize = 20
queryOptions.offset = queryOptions.pageSize.integerValue * page
// queryOptions.sortBy(["user.name desc"])
let dataQuery = BackendlessDataQuery()
dataQuery.queryOptions = queryOptions
dataQuery.whereClause = "name LIKE '%\(query)%'"
print(dataQuery.whereClause)
Backendless.sharedInstance().persistenceService.find(BackendlessUser.ofClass(), dataQuery: dataQuery, response: { (collection : BackendlessCollection!) -> Void in
success(items: collection.data as NSArray as! [BackendlessUser])
}, error: { (fault : Fault!) -> Void in
print(fault.message)
failure?()
})
},
catchblock: { (exception) -> Void in
print("findUsersWithQuery (FAULT): \(exception as! Fault)")
failure?()
})
}
I’m trying to search for users with a specific name (autocomplete as user types in the searchbar).
App ID:
“CB4376D8-C109-F602-FF72-26B158EF2000”
Any Ideas? Thanks!