【发布时间】:2013-06-06 06:59:45
【问题描述】:
这是我的代码
for(id tempLangItem in jp.staffData)
{
NSMutableDictionary *temp=[[NSMutableDictionary alloc] initWithDictionary:tempLangItem];
NSString *name = [temp objectForKey:@"lang_name"];
NSLog(@"item_name =%@",name);
NSLog(@"value in dictionary=%@",temp);
}
这些是日志详细信息
item_name =marinieres
value_in_dictionary={
"lang_id" = 2;
"lang_name" = "\U7a46\U840a\U65afmarinieres";
time = "2013-06-05 05:14:50";
}
为什么它在value_in_dictionary 日志中给出lang_name=\U7a46\U840a\U65afmarinieres 而它在item_name 日志中显示正确。
【问题讨论】:
-
你的
temp-dictionary 初始化的tempLangItem-dictionary 是什么?你能把它包含在你的代码中吗? -
@7SLEVIN 现在检查我的代码,我做了一些改进。
-
@7SLEVIN jp.staff 数据是 NSdictionary 的 NSArray。
-
将字符串转换为正确的格式,因为这些是正在显示的 UTF 字符
标签: ios ios5 nsstring nsdictionary