Hi,
I am using the following code to extract my classes from my database but when I try and iterate though the classes, strings are fine but ints and doubles always have a nil value. Any ideas why?
Also what is the correct code for swift for sorting queries? I checked the web docs and it only has the java code.
class Menu : NSObject {
var objectId : String?
var itemTitle : String?
var itemPrice : Double?
var itemDetails : String?
var itemHot : Bool?
var itemVegan : Bool?
var itemVege : Bool?
var itemGlutenFree : Bool?
var itemOffer : Bool?
var itemOfferPrice : Double?
var extraCategory : String?
var itemCategory : String?
}
Types.tryblock({ () -> Void in
let query = BackendlessDataQuery()
let menu = self.backendless.persistenceService.of(Menu.ofClass()).find(query)
let currentPage = menu.getCurrentPage()
menuArray = currentPage as! [Menu]
print(menuArray.count)
}) { (exception) -> Void in
print(“menu failed.”)
}
This is the line that returns nil :
menuArray[indexPath.row].itemPrice
Thanks