小编Ala*_*Lee的帖子

在 Parse iOS 中更新对象,[错误]:找不到对象

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.

    // Set up the Parse SDK
    let configuration = ParseClientConfiguration {
        $0.applicationId = "WhatsTheHW"
        $0.server = "https://whatsthehw-parse-alan.herokuapp.com/parse"
    }
    Parse.initializeWithConfiguration(configuration)

    let query = PFQuery(className: "Course")

    query.findObjectsInBackgroundWithBlock {(result: [PFObject]?, error: NSError?) -> Void in
        for object in result! {
            // existing objectIds: 1Ja2Hx77zA, 34AF1vKO6f, 5FWlsswxw0
            if object.objectId == "34AF1vKO6f" {
                object["studentRelation"] = ["hi", "ih"]
                object.saveInBackgroundWithBlock{(success, error) in
                    if success == true {
                        print("\(object) saved …
Run Code Online (Sandbox Code Playgroud)

ios parse-platform swift

5
推荐指数
1
解决办法
722
查看次数

标签 统计

ios ×1

parse-platform ×1

swift ×1