This is what I learned: when using self
block maintained
- To break the need for a
weakSelf
need cycle - I have a
strongSelf
self
We need to stop it from becoming zero half-way
So I want to test if any strong self
actually self
If you are alive:
@implementation ViewController - (zero) viewDidoad {{Su But viewdload]; NSLog (@ "viewDidLoad"); Self.test = @ "" test "; NSLog (@"% @ ", self.test); __vek type (self) weak Self = self; dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t) (3 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^ {__strong typeof (weakSelf) strongSelf = weakSelf; strongSelf.test = @ "newTest"; NSLog (@ "% @", strongSelf. tests);});} - (void) {Delok Anselog (@ " Delok ");} @ end
View controller will be pushed into a navigation controller and the output will immediately pop out
Why is it null?
Another question is, I have a project In indicating block are weak themselves
strongSelf
tones without me enough to indicate 11 accident related? To add worth it strongSelf
For each of them?
No comments:
Post a Comment