I am trying to empty an NSMutableArray with the [myarray removeallobjects]; but I am getting error exc_bad_access. Is this the right way to empty the array? I tried to set it to nil but its not working either.
Actually what I am doing is filling the array with data and the user has the option to “refresh” the data and I want to empty the array before enter the refreshed data.
I cant post any code because is too big.
I am trying to empty an NSMutableArray with the [myarray removeallobjects]; but I am
Share
-[NSMutableArray removeAllObjects]is the correct way of emptying anNSMutableArray. You’re most likely getting a crash because you’re still using the objects that you removed somewhere, in your UI perhaps.