0

如何在以下 JSON 响应中检查uids是否为 nil ?

{
height = 480;
pid = "F@dd705e6b96a6e894556c0db84870501e_d97383cc80238c38b8907d99690fa1c9";
tags =     (
            {
        attributes =             {
            glasses =                 {
                confidence = 97;
                value = false;
            };
            smiling =                 {
                confidence = 97;
                value = false;
            };
        };
        center =             {
            x = "60.83";
            y = "75.21";
        };
        gid = "<null>";
        height = "49.58";
        label = "";
        manual = 0;
        nose =             {
            x = "76.21";
            y = "77.16";
        };
        pitch = "-5.55";
        recognizable = 0;
        roll = "-0.45";
        uids =             (          // <<<<<========== UIDs Key
        );
        width = "66.11";
        yaw = "-19.56";
    }
);
url = "http://face.com/images/ph/a6e529853432599dad6da996746cb070.jpg";
width = 360;
}

当我尝试:

if ([[[[photo objectForKey:@"tags"] objectAtIndex:0] valueForKey:@"uids"] count] == 0)

它一直返回 FALSE。

我能够成功访问很多这些密钥。但正是这一把钥匙给我带来了问题。

就像,要访问url键,我正在使用:

[photo objectForKey:@"url"];

它工作得非常好。

我在uids键上做错了什么?

4

0 回答 0