My class has some @properties (strong); apples, bananas and oranges of NSArray*
type; and I'm wondering if this:
for(NSArray* __strong fruit in @[apples, bananas, oranges]) {
fruit = [fruit sortedArrayUsingComparator:comparator];
}
is the same as this:
apples = [apples sortedArrayUsingComparator:comparator];
bananas = [bananas sortedArrayUsingComparator:comparator];
oranges = [oranges sortedArrayUsingComparator:comparator];
comparator
is an NSComparator
.
I think they should be the same but I'm not sure how the __strong
relates to the for
loop in this context.