Hello,
I have a Request table with foundUsers column that contains a collection of objects from FoundUser table.
I created checkForRequest function to look for a user in FoundUser table whose recipientId equals the current user objectId.
I spent a lot of time trying to retrieve the properties of the related Request object. Can you please help me in the syntax?
func checkForRequest(){
var whereClause : String
var done = false
let user = backendless.userService.currentUser
if user != nil {
whereClause = "recepientId = '\(user.objectId!)'"
let dataQuery = BackendlessDataQuery()
dataQuery.whereClause = whereClause
let dataStore = self.backendless.persistenceService.of(FoundUser.ofClass())
var error: Fault?
let users = dataStore.find(dataQuery, fault: &error)
for user in users.data!
{
if done == false {
if error == nil {
print(" \(users.data)")
}
else {
print("Server reported an error: \(error)")
}
done = true
}
}
}
}
Thank you,