Here I got from JSON
[{\"photo\":null}]
and I use this code
NSMutableArray *jPhoto = [NSMutableArray arrayWithArray:(NSArray *)[jsonDict va
Hope so this helps.
-(NSMutableDictionary *)jsonCheckforNull:(NSMutableDictionary *)json{
NSMutableDictionary* strongjson=[json mutableCopy];
for (NSString *ktr in json) {
NSObject *str=[json objectForKey:ktr];
if ([str isKindOfClass:[NSArray class]]) {
if (!(str==[NSNull null])) {
NSArray *temp = [json allKeysForObject:str];
str=[[self ArrayCheckforNull:(NSMutableArray*)str]mutableCopy];
NSString *key = [temp objectAtIndex:0];
[strongjson removeObjectForKey:key];
[strongjson setObject:str forKey:key];
}
else
{
NSArray *temp = [strongjson allKeysForObject:str];
NSString *key = [temp objectAtIndex:0];
[strongjson removeObjectForKey:key];
[strongjson setObject:@"-----" forKey:key];
}
}
else if ([str isKindOfClass:[NSDictionary class]]) {
if (!(str==[NSNull null])) {
str=[[self jsonCheckforNull:str]mutableCopy];
NSArray *temp = [strongjson allKeysForObject:str];
NSString *key = [temp objectAtIndex:0];
[strongjson removeObjectForKey:key];
[strongjson setObject:str forKey:key];
}
else
{
NSArray *temp = [strongjson allKeysForObject:str];
NSString *key = [temp objectAtIndex:0];
[strongjson removeObjectForKey:key];
[strongjson setObject:@"-----" forKey:key];
}
}
else {
if (str ==[NSNull null]) {
NSArray *temp = [strongjson allKeysForObject:str];
NSString *key = [temp objectAtIndex:0];
[strongjson removeObjectForKey:key];
[strongjson setObject:@"----" forKey:key];
}
}
}
return strongjson;
}
-(NSMutableArray *)ArrayCheckforNull:(NSMutableArray *)arr{
NSObject *str;
NSMutableArray* strongArray=[[[NSMutableArray alloc]initWithArray:arr]mutableCopy];
for (str in arr)
{
if ([str isKindOfClass:[NSArray class]]) {
if (!(str==[NSNull null])) {
str=[[self ArrayCheckforNull:(NSMutableArray *)str]mutableCopy];
[strongArray removeObjectAtIndex:0];
[strongArray addObject:str];
}
else
{
[strongArray removeObject:str];
[strongArray addObject:@"----"];
}
}
else if ([str isKindOfClass:[NSDictionary class]]) {
if (!(str==[NSNull null])) {
str=[[self jsonCheckforNull:(NSMutableDictionary*)str]mutableCopy];
[strongArray removeObjectAtIndex:0];
[strongArray addObject:str];
}
else
{
[strongArray removeObject:str];
[strongArray addObject:@"----"];
}
}
else {
if (str ==[NSNull null]) {
[strongArray removeObject:str];
[strongArray addObject:@"----"];
}
}
}
return strongArray;
}