What is the best way to prevent my app from crash?
I’m using a JSON service that sometimes get NULL fields. What is the best way to prevent it?
Right now, I’ve to do this on every field:
if(![[[[Dictionary objectForKey:@"option"] objectForKey:@"option"] objectForKey:@"option"] isKindOfClass:[NSNull class]])
The problem is that the Dic is very complex, and sometimes I even get no the field I look for. So that’s a lot of validations.
Try this one :