This is my first attempt with Parse on Swift, and I've followed the quick start guide on Parse's website as seen here: https://parse.com/apps/quickstart#parse_data/mobile/ios/swift/existing
Unfortunately I get this error, 'PFObject' does not have a member named 'subscript'. I have followed the example code and instructions exactly as they are written and have redone this several times but with the same result. I really fail to see where I've gone wrong with this particularly as it's straight off the site. I'm on Xcode 6.4 targeting iOS SDK 8.4 using version 1.8.3 of the Parse library.
This is the code on the ViewController in the viewDidLoad method (I have remembered to include import Parse)
let testObject = PFObject(className: "TestObject")
testObject["foo"] = "bar"
testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in
println("Object has been saved.")
}
and this is the code I've added to AppDelegate. Again, I have imported Parse and Bolts as specified in the guide. This is the only code I have changed, the rest is as a standard blank single-view application would be. I have redacted the application ID and client key.
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
Parse.enableLocalDatastore()
Parse.setApplicationId("-redacted-",
clientKey: "-redacted-")
PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)
}
Any ideas as to how I might fix this or where I might have gone wrong?