我正在加载一个
JSON,但我想查看“URL”:“”,在json中,有时ID是空的,我该怎么检查?
if(URL == HOW TO CHECK IF EMPTY?) { } else { }
错误:
*** Terminating app due to uncaught exception 'NSRangeException',reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array' *** First throw call stack:
解决方法
嗯,试试吧
if ([URL isEqualToString:@"The URL?"]) {