ios 判断的方法isEqual 和 isKindOfClass 闪退
iOS 2020-03-31 16:30:22

 用

//                if([seller_type isEqual:[NSNull class]]) {

//                if([seller_type isKindOfClass:[NSNull class]]) {

 

在iOS12上都会闪退

 

我用的是这个,测试正常

if ([Result isEqualToString:@"<null>"]) {}

 

 


 

NSString *const infoConfig     = @"YOYO-Rongcloud";

NSString *const infoConfig_APP_KEY     = @"app_key";

//NSString *const infoConfig_CHANNEL     = @"CHANNEL";

     NSString *appkey = @"";

    

    if([param[@"appkey"] isEqualToString:@""] || param[@"appkey"] == nil){

        NSString *path = [[NSBundle mainBundle]pathForResource:@"Info" ofType:@"plist"];

        NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];

        appkey = dict[infoConfig][infoConfig_APP_KEY];  // appkey

    }else{

        appkey = param[@"appkey"];

    }

 

 

 

 

本文来自于:http://www.yoyo88.cn/study/swift/503.html

Powered by yoyo苏ICP备15045725号-1