【发布时间】:2014-07-16 08:13:52
【问题描述】:
我有用户信息字典,它是从网络服务中获取的。有些字段的内容是私有的,因此它包含 NULL。如何将值转换为空字符串,只要有以下字典中的 null 值:
{
"about_me" = "<null>";
"contact_number" = 123456798798;
"display_name" = "err";
followers = 0;
following = 4;
gender = "-";
posts = 0;
"user_id" = 18;
username = charge;
website = "<null>";
}
【问题讨论】:
-
[_dictionary setValue:@"" forKey:@"about_me"];和你想在 mutable 字典中更新的每个键的相同过程。 -
这不是
NSArray,而是NSDictionary。
标签: ios iphone objective-c ios7