What is the most memory efficient way to loop through an NSMutableArray of custom objects? I need to check a value in each object in the array and return how many of that type of object is in the array.
for (WhateverYourClassNameIs *whateverNameYouWant in yourArrayName) {
[whateverNameYouWant performSelector];
more code here;
}
It's called fast enumeration and was a new feature with Objective C 2.0, which is available on the iPhone.
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