1
嗨,我是新來的Backendless。請幫忙。我在使用ios時遇到了使用未聲明類型'BackendlessCollection'的錯誤。迅速使用未申報類型'BackendlessCollection'
我已經寫功能retrieveBlurbs()在主頁視圖controller.I已創建了一個更對象medicineList類這樣
class medicineList : NSObject
{
var objectId : String?
var name : String?
var desc : String?
var created : NSDate?
var updated : NSDate?
}
func retrieveBlurbs()
{
var backendless = Backendless.sharedInstance()
let query = BackendlessDataQuery()
// Use backendless.persistenceService to obtain a ref to a data store for the class
backendless.persistenceService.ofTable(medicineList.ofClass()).find(query, response: { (medicineList : BackendlessCollection!) ->() in
let currentPage = medicineList.getCurrentPage()
print("Loaded \(currentPage.count) medicineList objects")
print("Total restaurants in the Backendless starage - \(medicineList.totalObjects)")
for medicineList in currentPage as! [medicineList]
{
print("Medicine name = \(medicineList.name)")
}
} , error: { (fault : Fault!) ->() in
print("Server reported an error: \(fault)")
})
}
我編輯woof答案...但仍然得到一個錯誤,如'不能轉換任何類型的值!到期望的參數類型字符串!'錯誤行PersistanceService行代碼 –
後端連接我在開始時正確 –
你可以給我發送一個示例代碼來檢索後臺表中的所有名稱列表..我需要在表視圖控制器中顯示該表列表。 –