Hi
I have searched this forum and google for 2 days and I still can’t resolve the error stated in the title.
I am using SWIFT in an iOS project. I have a very simple test table:
import Foundation
class Signupcode : NSObject {
var signupcode : String?
var usecount: Int?
var objectId : String?
var ownerId: String?
var created: NSDate?
var updated: NSDate?
//var owner : BackendlessUser?
}
I was able to retrieve 1 object from backendless :
whereClause = signupcode = ‘1345’
Loaded 1 signupcodes objects
I got the error in this function:
func checkSignupcode(mysignupcode : String) -> Bool {
var isvalid = false
let mysignupcode = userInfo["signupcode"]!
let whereClause = "signupcode = '\(mysignupcode)'"
print("whereClause = \(whereClause)")
let dataQuery = BackendlessDataQuery()
dataQuery.whereClause = whereClause
backendless.persistenceService.of(Signupcode.ofClass()).find(
dataQuery,
response: { ( signupcodes : BackendlessCollection!) -> () in
let currentPage = signupcodes.getCurrentPage()
print("Loaded \(currentPage.count) signupcodes objects")
print("Total Signupcode in the Backendless storage - \(signupcodes.totalObjects)")
//let sudata = signupcodes.
for signupcodedata in currentPage as! [Signupcode] {
print("Signupcode = \(signupcodedata.signupcode)")
print("usecount = \(signupcodedata.usecount)")
}
isvalid = true
//print("Total time (ms) - \(1000*NSDate().timeIntervalSinceDate(startTime))")
},
error: { ( fault : Fault!) -> () in
print("Server reported an error: \(fault)")
}
)
return isvalid
}
}
HELP!!