- In some block APIs of the system, the block version of UIView is animated when it is written
不需要
,但也有一些api 需要考虑
- The following use methods
不会
cause circular reference problems
[UIView animateWithDuration:duration animations:^{ [self.superview layoutIfNeeded]; }];[[NSOperationQueue mainQueue] addOperationWithBlock:^{ self.someProperty = xyz; }];[[NSNotificationCenter defaultCenter] addObserverForName:@"someNotification" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * notification) { self.someProperty = xyz; }];
However, if some of the parameters in the method are member variables, you can cause circular references, such as GCD, Nsnotificationcenter calls should be careful, such as GCD internal if self is referenced, and the parameters of the GCD is a member variable, you have to consider the circular reference, for example:
Do you also consider circular reference issues when using some of the system's block APIs, such as the block version of UIView?