1
[UIView animateWithDuration:0.2
                          delay:0.0f
                        options:UIViewAnimationOptionCurveEaseIn
                     animations:^{
                         self.imgViewEnterFrame.alpha = 1.0 ;
                         self.imgViewOutofFrame.alpha = 0.0;
                         self.imgViewEnterFrame.frame = self.rectEnterGoodFrame;
                     }
                     completion:nil];
icodebuster
  • 8,890
  • 7
  • 62
  • 65
Hedy Lau
  • 35
  • 6

1 Answers1

1

This is not a retain cycle. You get retain cycles when you use repeating timers or reference self in a class block property/variable, or something like that. None of those appear to be an issue in this code snippet.

Is this a theoretical question, or do you have evidence of a retain cycle (i.e. your controller is not getting released when it is dismissed)?

Rob
  • 415,655
  • 72
  • 787
  • 1,044
  • This is wrong. Length of time has nothing to do with whether there's a cycle. There is no "cycle" here. – newacct Jun 17 '13 at 23:13
  • @newacct I didn't mean to suggest that the length of time had anything to do with whether the cycle or not. I tried to say this was not a cycle. I was trying to say that in some cases (e.g. `dispatch_async`), the object will be retained for the duration of a block. But clearly I didn't articulate that well (and in fact, this isn't applicable to animations, anyway), so I just removed that from my answer to avoid confusion. – Rob Jun 17 '13 at 23:48