swift - How to properly Pin in Parse localDataStore? -
i have parse.enablelocaldatastore()
in app delegate before parse.setapplicationid
then have var newposts = pfobject(classname: "post")
global variable.
then want 1,000 latest objects "post" table localdatastore enabled earlier this:
var getnewposts = pfquery(classname: "post") getnewposts.fromlocaldatastore() getnewposts.limit = 1000 getnewposts.orderbydescending("createdat") getnewposts.findobjectsinbackgroundwithblock { (downloadedposts, error) -> void in if downloadedposts != nil && error == nil { println(downloadedposts) // getting table no data } }
but empty data rows. if comment out getnewposts.fromlocaldatastore()
line results fine.
i understand missing critical pinning step not sure parse documentation hoe , implement it. can please help?
you getting no data.... reasons be...
wrong name of class (class names case sensitive) data not there in local storage
try synchronous version of findobject: method , pin: method.
Comments
Post a Comment