I'm loading an JSON but i want to check of the "URL": "",
in the json is empty sometimes the ID is empty how can i check?
if(URL == HOW TO CHECK IF EMPTY?)
{
}
else
{
}
Error:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array'
*** First throw call stack:
Hmm, try
if ([URL isEqualToString:@"The URL?"]) {
If the URL object is a string, you can use either,
if([string length] == 0) { //empty }
or
if([string isEqualToString:@""]) { // empty }
If the URL object is an NSURL, you can use:
if([[url absoluteString] isEqualToString:@""]) { //empty }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With