I am trying to detect if an array isn't empty in order to be able to do a certain call.
I tried using if (![array ==nil]) however that doesn't compile.
I'm sure there is a really easy explanation to this.
Update
If array is empty I want to do this:
array = [[NSMutableArray alloc]init];
If it has an object I want to do this:
array = [[userDefaults arrayForKey:@"MyFavorites"] mutableCopy];
NSMutableArray array;? Did you already assign it to anything else before this?nilwould beif (array != nil)— no message-sending brackets. However,niland an empty array are two different values. If you want to check for an empty array, useif ([array count] != 0).