判断字符串是否为空

#pragma mark - 判断字符串是否为空

- (BOOL) isBlankString:(NSString *)string {

    if (string == nil || string == NULL || [string isEqualToString:@"<null>"]) {

        return YES;

    }

    if ([string isKindOfClass:[NSNull class]]) {

        return YES;

    }

    if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) {

        return YES;

    }

    return NO;

}

 

if (![dict[@"store_photos"] isKindOfClass:[NSNull class]]){

}

posted @ 2017-04-20 10:44  柳仙慧子  阅读(139)  评论(0编辑  收藏  举报