I have nsmutable array and I want to add object at particular index, how can I check if the array at particular index has a object or not?
I was doing this:
if ([self.myArray objectAtIndex:index] !=nil) {
but I'm getting exceptions most of the time because "beyond bounds"
I'll really appreciate your help
Easiest (may be not the best) will be
if ([self.myArray count] > index && [self.myArray objectAtIndex:index] !=nil)
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