Hello,
I have been having a problem recently, where using datastore.find only (even sometimes) works when I uninstall and reinstall my app on my iphone. I am calling it asynchronously, and my function is fairly simple:
func getAllInterestsAsync()
{
let backendless = Backendless.sharedInstance()
let query = BackendlessDataQuery()
let dataStore = backendless.persistenceService.of(Interest.ofClass()) as IDataStore
dataStore.find(query,
response: { (retrievedCollection) -> Void in
print("Successfully retrieved Interest")
let interests = retrievedCollection.data as? [Interest];
for interest in interests! {
print("interest = \(interest.name)")
}
self.delegate?.AllInterestsAreRetrieved!(interests!)
})
{ (fault) -> Void in
print("Server reported an error: \(fault)")
}
}
The function (according to breakpoints) is crashing exactly at datastore.find, and the error is as follows:
*** Terminating app due to uncaught exception of class 'Fault'
libc++abi.dylib: terminating with uncaught exception of type Fault
(lldb)
I am calling the function like this:
Types.tryblock({ () -> Void in
self.backendlessactions.getAllInterestsAsync()
},
catchblock: { (exception) -> Void in
print("Server reported an error: \(exception as! Fault)")
})
does anyone have any ideas how I can fix this or what my problem might be? I have removed and re-installed the backendless SDK as well, but that did not do anything.