If I have the following piece of code:
for (UIView *view in [myArray copy])
Does that mean that I'm sending the copy
message to myArray
on every iteration, or Objective-C is smart enough to do copy
only once, and use it for the whole loop?
It isn't a matter of "smart", but yes, the expression [myArray copy]
is evaluated once up front.
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