[英]How can i get email and password value from this output which is response from web service in iOS?
Since i convert webservice response into Json and assign into NSDictionary. 由于我将Web服务响应转换为Json并分配给NSDictionary。 When i print out the contents in dictionary then it gives the output below. 当我在字典中打印出内容时,它给出下面的输出。 My problem is How can i get email and password value from this output? 我的问题是如何从此输出中获取电子邮件和密码值?
Key is post, Value is 关键是发布,价值是
(
{
post = {
"active_flag" = Y;
email = "g.amit@jasapp.com";
"first_name" = amit;
"last_name" = gupta;
"member_id" = 17;
password = amitgupta;
};
}
)
NSMutableDictionary *temDict = [self.YourAarray objectAtIndex:0];
NSlog(@"%@",[temDict objectForKey:@"email"]);
NSlog(@"%@",[currentHighscore objectForKey:@"password"]);
For example, if the NSDictionary
you are creating from JSON is named jsonDict
, the following code should work: 例如,如果您要从JSON创建的NSDictionary
名为jsonDict
,则以下代码应该起作用:
NSDictionary *post = [jsonDict objectForKey:@"post"];
NSString *email = [post objectForKey:@"email"];
NSString *password = [post objectForKey:@"password"];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.