我有一个NSMutableArray
,它是根据用户的选择设置的。我不是试图将其传递给设置为我的parameter
的NSDictionary
以发送到我的服务器。我想要抓住parameters
内的那些值。将NSMutableArray设置为NSDictionary - 目标C
我在做什么的继承人:
NSMutableArray
:被设置在以下几点:[_selectedCells addObject:label.text];
NSDictionary *dictionary = @{ @"title": _titlefor.text,
@"description": _description.text,
@"time_limit": _timeLimit.date, @"toWho": @""};
toWho
在这里我想给用户选择的值。
我试过类似的东西,[dictionary setValue:self.viewControllers.selectedCells forKey:@"toWho"];
但是这不能正常工作。
我想我将不得不使用NSMutableDictionary
,但是我可以将此发送给parameters
以发送到我的服务器吗?
继承人如何我加入parameters
:
NSMutableURLRequest *request = [httpClient multipartFormRequestWithMethod:@"POST" path:@"downloadFileChallange.php" parameters:dictionary constructingBodyWithBlock:^(id <AFMultipartFormData>formData)
{
[formData appendPartWithFileData:webData name:@"file" fileName:newUsername mimeType:@"video/quicktime" ];
}];
建议,想法?
如果您打算在其中设置值或为其添加值,那么您肯定需要使用可变字典。但是,我不明白问题的第二部分,所以我对此没有答案。 – user1118321
@ user1118321你不了解它吗? –
我之前没有使用过'NSMutableURLRequest',所以我不知道如果只是设置'参数'参数到字典将工作。抱歉! – user1118321