草庐IT

productIdList

全部标签

ios 检查是否 nsarray == null

我从JSON收到一些响应,并且工作正常,但我需要检查一些null值,我找到了不同的答案,但似乎仍然无法正常工作,NSArray*productIdList=[packItemDictionaryobjectForKey:@"ProductIdList"];我试过if(!productIdList.count)//whichbreakstheapp,if(productIdList==[NSNullnull])//warning:comparisonofdistinctpointertypes(NSArrayandNSNull)那么发生了什么?如何解决此问题并检查数组中的null?谢谢!

ios 检查是否 nsarray == null

我从JSON收到一些响应,并且工作正常,但我需要检查一些null值,我找到了不同的答案,但似乎仍然无法正常工作,NSArray*productIdList=[packItemDictionaryobjectForKey:@"ProductIdList"];我试过if(!productIdList.count)//whichbreakstheapp,if(productIdList==[NSNullnull])//warning:comparisonofdistinctpointertypes(NSArrayandNSNull)那么发生了什么?如何解决此问题并检查数组中的null?谢谢!