加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何检查ios sdk中的数组是空还是空?

发布时间:2020-12-14 18:57:13 所属栏目:百科 来源:网络整理
导读:我想检查我的Bond是否为空或null和NULL值. {Bonds =( { DOB = "12/09/1988"; about = ""; } );User = { city = CA; email = "karmhadadmtl@gmail.com";};success = True;} 第二次这种类型获取数据如何检查Bond键 {Bonds = Null;User = { city = CA; email =
我想检查我的Bond是否为空或null和NULL值.

{
Bonds =(
      {
        DOB = "12/09/1988";
        about = "";
      }
      );
User =     {
    city = CA;
    email = "karmhadadmtl@gmail.com";
};
success = True;
}

第二次这种类型获取数据如何检查Bond键

{
Bonds = Null;
User =     {
    city = CA;
    email = "developer.i12@gmail.com";
};
success = True;
}

解决方法

你只需检查零

if(data[@"Bonds"]==nil){
  NSLog(@"it is nil");
}

要么

if ([data[@"Bonds"] isKindOfClass:[NSNull class]]) {
    NSLog(@"it is null");
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读