NSDictionary *paramAddr = [[NSDictionary alloc] initWithObjectsAndKeys:
_registerUser.au_name,@"au_name", _registerUser.au_password,@"au_password",_house_area.text,@"hou_area",
_hou_id,@"hou_id",
_au_is_binding,@"au_is_binding",
nil];
上面方法创建字典时,多个Key的时候,中间有回车换行的话,会导致字典缺少元素。
建议按如下方法(添加前最好判断各个值是否为空的情况):
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
[dic setObject:_registerUser.au_name forKey:@"au_name"];
[dic setObject:_registerUser.au_password forKey:@"au_password"];
[dic setObject:_house_area.text forKey:@"hou_area"];
[dic setObject:_hou_id forKey:@"hou_id"];
[dic setObject:_au_is_binding forKey:@"au_is_binding"];
时间: 2024-11-10 06:21:21