gpt4 book ai didi

ios - 我的字典是空的,尽管它有值

转载 作者:行者123 更新时间:2023-11-28 18:55:55 24 4
gpt4 key购买 nike

我有一个非常奇怪的问题我有这些值的字典

NSDictionary * dic = [NSDictionary dictionaryWithObjectsAndKeys:@"1",@"usr_id",areaChoosedId,@"usr_adrs", _username.text ,@"usr_psd", _name.text ,@"usr_name",_mobile.text,@"usr_tel",_email.text,@"usr_mail",_password.text,@"usr_pwd",usr_ava,@"usr_ava", nil];

但是当我打印字典时它会输出

{
"usr_id" = 1;
}

虽然当我打印用户名或手机或电子邮件时都有值而不是 nil 那么问题是什么?

最佳答案

使用这个。您似乎没有获得 areaChoosedId 的值。

NSMutableDictionary * dic = [[NSMutableDictionary alloc] init];
[dic setObject:@"1" forKey:@"usr_id"];
[dic setObject:areaChoosedId forKey:@"usr_adrs"];
[dic setObject:_username.text forKey:@"usr_psd"];
[dic setObject: _name.text forKey:@"usr_name"];
[dic setObject: _mobile.text forKey:@"usr_tel"];
[dic setObject: _email.text forKey:@"usr_mail"];
[dic setObject: _password.text forKey:@"usr_pwd"];
[dic setObject: usr_ava forKey:@"usr_ava"];

希望它对你有用。

关于ios - 我的字典是空的,尽管它有值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33074136/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com