I am unable to check if one of my keys is empty.
Following is the parsed JSON response I am working with :
Case 1 (key 'tags' is not empty)
{
height = 480;
pid = "a@bsioihf93u420934";
tags = (
{
attributes = {
mood = {
confidence = 42;
value = happy;
};
smiling = {
confidence = 52;
value = false;
};
};
center = {
x = "49.86";
y = "60.52";
};
confirmed = 0;
width = "50.28";
}
);
url = "http://abc/efg/hijk/lmnop.jpg";
width = 360;
}
There are times when the response looks like the following :
Case 2 (key 'tags' is empty)
{
height = 480;
pid = "a@bsioihf93u420934";
tags = (
);
url = "http://abc/efg/hijk/lmnop.jpg";
width = 360;
}
When I check if 'tags' is empty in case 2, it returns false :
if ([photo objectForKey:@"tags"] == nil)
Checking the actual value of [photo objectForKey:@"tags"]
in logs returns :
(
)
How else can I check if 'tags' is empty ?