Skip to main content
deleted 22 characters in body
Source Link
John Kugelman
  • 364.3k
  • 70
  • 555
  • 600

hello iI am trying to detect if an array isnt emptryisn't empty in order to be able to do a certain call. I tried using this code if (![array ==nil]) however the code doesnt buildthat doesn't compile. ImI'm sure there is a really easy explanation to this.

Update

UPDATE ifIf array is empty iI want to do this:

    array = [[NSMutableArray alloc]init];       

ifIf it has an object i I want to do this:

    array = [[userDefaults arrayForKey:@"MyFavorites"] mutableCopy];

thanks

hello i am trying to detect if an array isnt emptry in order to be able to do a certain call. I tried using this code if (![array ==nil]) however the code doesnt build. Im 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];

thanks

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];
added 221 characters in body
Source Link
Alex Stelea
  • 1.2k
  • 2
  • 18
  • 29

hello i am trying to detect if an array isnt emptry in order to be able to do a certain call. I tried using this code if (![array ==nil]) however the code doesnt build. Im 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];

thanks

hello i am trying to detect if an array isnt emptry in order to be able to do a certain call. I tried using this code if (![array ==nil]) however the code doesnt build. Im sure there is a really easy explanation to this.

hello i am trying to detect if an array isnt emptry in order to be able to do a certain call. I tried using this code if (![array ==nil]) however the code doesnt build. Im 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];

thanks

edited tags
Link
BoltClock
  • 728k
  • 165
  • 1.4k
  • 1.4k
Source Link
Alex Stelea
  • 1.2k
  • 2
  • 18
  • 29
Loading