0

由于我将 web 服务响应转换为 Json 并分配到 NSDictionary。当我打印出字典中的内容时,它会给出下面的输出。我的问题是如何从此输出中获取电子邮件和密码值?

关键是帖子,价值是

(
        {
        post =         {
            "active_flag" = Y;
            email = "g.amit@jasapp.com";
            "first_name" = amit;
            "last_name" = gupta;
            "member_id" = 17;
            password = amitgupta;
        };
    }
)
4

2 回答 2

0
 NSMutableDictionary *temDict = [self.YourAarray objectAtIndex:0];  
 NSlog(@"%@",[temDict  objectForKey:@"email"]);
 NSlog(@"%@",[currentHighscore objectForKey:@"password"]);
于 2012-10-06T13:59:43.497 回答
0

例如,如果NSDictionary您从 JSON 创建的名称为jsonDict,则以下代码应该可以工作:

NSDictionary *post = [jsonDict objectForKey:@"post"];
NSString *email = [post objectForKey:@"email"];
NSString *password = [post objectForKey:@"password"];
于 2012-10-06T14:05:26.943 回答