0

I have written this Parse.enableLocalDataStore() in my AppDelegate file after the Parse.setApplicationID() & I got error that:

Parse.Type does not have a member named 'enableLocalDataStore'

Can anyone tell me that how to create local datastore in swift for parse.

3
  • You have included all needed imports, bridging files, frameworks and linked libraries? Commented Dec 31, 2014 at 12:49
  • yes and i am listing them here... Commented Dec 31, 2014 at 13:14
  • -Audiotoolbox.framework -CFNetwork.framework -CoreGraphics.framework -CoreLocation.framework -libz.dylib -MobileCoreServices.framework -QuartzCore.framework -Security.framework -StoreKit.framework -SystemConfiguration.framework -libsqlite3.dylib -Parse.framework -Bolts.framework -ParseUI.framework -ParseFacebookUtils.framework Commented Dec 31, 2014 at 13:16

8 Answers 8

1

Just in case someone comes across this question the answer is you are mistyping

enableLocalDataStore() 

you should type

enableLocalDatastore() 

The capital S makes the difference

EDIT: As some other users pointed out you have another mistake which is writting Parse.enableLocalDatastore() after setting the application ID, it should appear before. So there are, as far as I can tell those 2 mistakes.

Sign up to request clarification or add additional context in comments.

Comments

0

Make sure you have Parse SDK 1.6.1. Then Parse.enableLocalDatastore() goes before Parse.setApplicationID()

1 Comment

I have tried that also still i'm getting the same error Parse.Type does not have a member named 'enableLocalDataStore'
0

Just in case...I had a similar problem, and the reason was my project's name...I was using "Parse", and I changed it to something else and now is working.

Comments

0

Most likely you Parse SDK is out of date. Look in the Parse.h in parse library, and if it doesn't contain the enableLocalDatastore method, you need to update your library. Follow this link to update it. Update Parse SDK

2 Comments

Thanks after the updation it started working..is there any tutorial for using Local Datastore methods in Swift
Im new to Parse also. What are you trying to do? Check out this link. link Depending on what you are trying to do, it may be easier to just set a cachePolicy on your queries and let Parse handle it for you. It only takes one line 'query.cachePolicy = kPFCachePolicyCacheThenNetwork'
0

This is actually a known issue. Facebook will be providing a fix for this in the next SDK release.

Comments

0

The Parse documentation states that if you wish to use local storage then you must enable this BEFORE your app/client keys in your AppDelegate.

Comments

0

enableLocalDataStore() before setting applicationId. This is works without any errors/warnings in the latest SDK (1.6.4)

 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
   .....
    //enable local store to work when network isnt available
    Parse.enableLocalDatastore()

    //parse sdk setup
    Parse.setApplicationId("appIdGoesHere", clientKey: "clientKeyGoesHere")
    PFUser.enableAutomaticUser()

    return true
}

Comments

0

From https://parse.com/docs/ios/guide#local-datastore

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    Parse.enableLocalDatastore()
    Parse.setApplicationId("parseAppId", clientKey: "parseClientKey")
  }
}

I think the order is important.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.