swift - Use of undeclared type 'BackendlessCollection' -
hi new backendless. please help. getting error use of undeclared type 'backendlesscollection' while using in ios . swift
i have written function retrieveblurbs() in home view controller.i have created 1 more object medicinelist class this
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 obtain ref data store 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 backendless starage - \(medicinelist.totalobjects)") medicinelist in currentpage as! [medicinelist] { print("medicine name = \(medicinelist.name)") } } , error: { ( fault : fault!) -> () in print("server reported error: \(fault)") }) }
enter image description herei'm not sure, helpful
i've looked @ api, if using asynchronous method signatures, method "find" query variable has 2 non optional blocks response , error.
i try change method this:
func retrieveblurbs() { var backendless = backendless.sharedinstance() let query = backendlessdataquery() // use backendless.persistenceservice obtain ref data store class backendless.persistenceservice.oftable(medicinelist.ofclass()).find(query) { medicinelist in let currentpage = medicinelist.getcurrentpage() print("loaded \(currentpage.count) medicinelist objects") print("total restaurants in backendless starage - \(medicinelist.totalobjects)") medicinelist in currentpage as! [medicinelist] { print("medicine name = \(medicinelist.name)") } } , { fault in print("server reported error: \(fault)") } }
if won't help, maybe have make sdk setup beginning, module or file might missing during first setup
Comments
Post a Comment