I want to set an object to 'nil' as I enumerate through an array, as follows:
for(Object* object in array){
object = nil;
}
Xcode then tells me 'Fast enumeration variables can't be modified in ARC by default; declare the variable __strong to allow this.'
Which means doing this:
for(Object __strong* object in array){
object = nil;
}
This seems to be redundant. As far as I understand, declaring a strong reference to an object increases its retain count by one, and nil-ing it decreases the retain count by one. So how, then, do I set an object to nil
while enumerating through an array?
I am using ARC.