Hello,
I have a problem that occurs only after releasing an app to AppStore. This piece of code works fine in testing on device and simulator, but fails in AppStore…
obj as? Place casting fails.
func restaurantsAsync() {
let dataStore = Backendless.sharedInstance().data.of(Place.ofClass())
dataStore.find({ (result: BackendlessCollection!) in
let places = result.getCurrentPage()
for obj in places {
if let place = obj as? Place {
DataManager.places.append(place)
}
}
self.tableView.reloadData()
}) { (error: Fault!) in
print("Server reported an error: \(error.faultCode)")
}
}
class Place: NSObject, MKAnnotation {
var objectId: String?
var name: String?
var geoPoint: GeoPoint? {
didSet {
self.coordinate = CLLocationCoordinate2D(latitude: geoPoint!.latitude as CLLocationDegrees, longitude: geoPoint!.longitude as CLLocationDegrees)
}
}
var startingTime: NSDate?
var endingTime: NSDate?
var price: Int = 0
var background: String? // url to background image in table view cell
var front: String? // url to image in detail view controller
var address: String?
var descr: String?
var coordinate = CLLocationCoordinate2D(latitude: 43.230401, longitude: 76.929576)
var phone: String?
var title: String? {
return name
}
var distance: CLLocationDistance?
}
App ID: 88323413-A691-A972-FF3A-DA0F1A87B400
The name of the table is: Place