A day or so ago I posted this question: Confused about enumeration... How do I change the objects that during enumeration?
I learned that I can call methods on an object during enumeration, but if I assign using the "=" operator then it creates a new object (not what I want).
The linked question shows how to use setString on an array of NSString objects... but now my question is for custom objects
Here's what I want to do
for (Car * car in self.carsArray)
{
if (car.name == nil){
car = [self getrandomCar];
}
}
However, the "=" operator isn't going to work for me... is there some type of method I can use like this?
[car setObject:[self getrandomCar];
Thanks!