Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling local data store on Parse by calling enableLocalDatastore before initialization throws exception

In Parse docs, it clearly states that [Parse enableLocalDatastore]; should be called before [Parse setApplicationId:clientKey:];: https://parse.com/docs/ios_guide#localdatastore-find/iOS

However, in my case, it immediately throws an exception:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You have to call setApplicationId:clientKey: on Parse to configure Parse.'

If I move the code to execute after [Parse setApplicationId:clientKey:]; I don' get an error, but local store doesn't seem to work.

Seems that Parse's own docs are misleading. Anyone got a solution?

like image 476
Can Poyrazoğlu Avatar asked Dec 12 '14 02:12

Can Poyrazoğlu


2 Answers

I put the [Parse enableLocalDatastore]; after the [Parse setApplicationId:clientKey:]; and i got another errors. But this another errors was because you can't use Local Datastore and Cache Policy together. When i removed the Cache Policy's methods everything works fine. So, i don't know if this is a documentation mistake, but you have to put this code after.

like image 158
Henrique Güttler Morbin Avatar answered Oct 16 '22 23:10

Henrique Güttler Morbin


This should be fixed in the new v1.6.1 version of the Parse SDK.

like image 23
Héctor Ramos Avatar answered Oct 17 '22 00:10

Héctor Ramos