The code below is what I had before in my app.
Before:
if ([dic objectForKey:@"text"] isKindOfClass:[NSString class]] && [dic objectForKey:@"text"] != nil && [dic objectForKey:@"text"] != [NSNull Null]) {
NSString *text = [dic objectForKey:@"text"];
}
I've changed the code to the following below.
After:
if ([dic objectForKey:@"text"] isKindOfClass:[NSString class]]) {
NSString *text = [dic objectForKey:@"text"];
}
I believe the results should be the same ,but the latter is neater. Just to be safe, I am asking this question to make sure I'm right about this and not overlooking anything.