Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 在“中发送多个参数”;withParameters:“;呼叫_Objective C_Parse Platform - Fatal编程技术网

Objective c 在“中发送多个参数”;withParameters:“;呼叫

Objective c 在“中发送多个参数”;withParameters:“;呼叫,objective-c,parse-platform,Objective C,Parse Platform,您好,我需要知道如何通过withParameters:method发送两个对象 这是我的密码: NSDictionary *numberparam = [NSDictionary dictionaryWithObject:phoneNumber forKey:@"number"]; NSDictionary *messageparam = [NSDictionary dictionaryWithObject:message forKey:@"message"]; [P

您好,我需要知道如何通过withParameters:method发送两个对象

这是我的密码:

    NSDictionary *numberparam = [NSDictionary dictionaryWithObject:phoneNumber  forKey:@"number"];
    NSDictionary *messageparam = [NSDictionary dictionaryWithObject:message forKey:@"message"];

    [PFCloud callFunctionInBackground:@"inviteWithTwilio" withParameters:numberparam messageparam block:^(id object, NSError *error) {
        NSString *message1 = @"";

如果我从PFCloud调用中取出messageparam,一切都正常,但我需要包含它。如何做到这一点?

您可以将它们放在字典中:

NSMutableDictionary * params = [NSMutableDictionary new];
params[@"number"] = phoneNumber;
params[@"message"] = message;
[PFCloud callFunctionInBackground:@"inviteWithTwilio" withParameters:params block:^(id object, NSError *error) {
    NSString *message1 = @""; 
}];
然后,在云计算中使用

var phoneNumber = request.number;
var message = request.message;

你可以把它们放在一本字典里:

NSMutableDictionary * params = [NSMutableDictionary new];
params[@"number"] = phoneNumber;
params[@"message"] = message;
[PFCloud callFunctionInBackground:@"inviteWithTwilio" withParameters:params block:^(id object, NSError *error) {
    NSString *message1 = @""; 
}];
然后,在云计算中使用

var phoneNumber = request.number;
var message = request.message;

不兼容的指针类型正在将“NSArray*”发送到“NSDictionary*”类型的参数。您是否看到更新,我的第一个原始数组答案是错误的。我试图在你看到它之前更新它!不兼容的指针类型正在将“NSArray*”发送到“NSDictionary*”类型的参数。您是否看到更新,我的第一个原始数组答案是错误的。我试图在你看到它之前更新它!