0

I followed the example LOAD OBJECTS FROM AN MBAAS STORAGE, from Backendless site, however I've got an error (saying Value of type 'AnyObject' has no member 'name') trying to get the values (from Restaurant collection) by direct reference as in the example :

for restaurant in currentPage {
print("Restaurant name = \(restaurant.name)")
}
Hermes
  • 467
  • 5
  • 8

1 Answers1

2

Adding a little change in the code (using Swift 2.0.+), just in case anyone has the same problem that I had.

So I added an explicit reference instead.

for restaurant in currentPage {
let rest : Restaurant = restaurant as! Restaurant
print("Restaurant name = \(rest.name!)")
}

This way you get the value wanted, no error thrown.

I hope this help some one.

Regards

Hermes
  • 467
  • 5
  • 8