简体   繁体   English

PARSE框架未返回云功能并且引发了不合理的问题

[英]Cloud Function is not returning and Unreasonable issue throwing by PARSE Framework

Actually my Requirement is Simply store the data and pass stored data in callback. 实际上,我的要求是简单地存储数据并在回调中传递存储的数据。 Here am not handling any Date things. 这里不处理任何日期的事情。 Because Parse crash StrackTrace is saying crash is happing the conversion between Date as String. 因为解析崩溃,StrackTrace表示崩溃使Date(日期)为String(字符串)之间的转换受到限制。 But this thing i don't care. 但是这个东西我不在乎。 Because i am not handling any date in Client side 因为我不在客户端处理任何日期

// The following code is Objective C: //以下代码是目标C:

- (IBAction)didTapStoreButton:(id)sender {

        NSMutableDictionary *params = [NSMutableDictionary new];
        params[@"userObjectId"] = [[PFUser currentUser] objectId];
        params[@"name"] = @"apple";

        [PFCloud callFunctionInBackground:@"vendorCloudFunc"
                           withParameters:params
                                    block:^(id object, NSError *error) {
                                        PFObject *pfObject = object;
                                        if (object) {
                                            NSLog(@"pfObject: %@",pfObject);

                                        } else {
                                            NSLog(@"%@",error.localizedDescription);
                                        }
                                    }];
    }

// The following code is Cloud Function in Parse :
    Parse.Cloud.define("vendorCloudFunc", function(request, status) {
        var toSaves = [];
        var MySpecialObject = Parse.Object.extend("newclass");
        var myObject = new MySpecialObject();
            myObject.set("userObjectId",request.params["userObjectId"]);
            myObject.set("name",request.params["name"]);
           toSaves.push(myObject);
        console.log('## myObject: '+myObject);
        Parse.Object.saveAll(toSaves, {
            success: function(saveList) {
            console.log('## newClass first Record:'+saveList[0]);
                status.success(saveList[0]);
            },
            error: function(error) {
                console.log(error);
                status.error("Unable to save objects.")
            }
        });
        });

检查此屏幕截图。 **崩溃在解析框架中发生**

I don't have clue, Why this crash is happening.? 我没有线索,为什么会发生这种崩溃。

您将传递NSDate实例而不是NSString实例作为“字符串”参数,因此NSDate中没有UTF8String方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM