I am trying to understand this code :
__weak LoginViewController *weakSelf = self;
NSTimer *networkTimer = [NSTimer pym_scheduledTimerWithTimeInterval:15.0 block:^{
LoginViewController *strongSelf = weakSelf;
[strongSelf timeout];
} repeats:NO];
[PYMAuthManager loginWithUsername:username password:password completionHandler:^(BOOL successful) {
if (successful) {
[networkTimer invalidate].......
it's for a network timer, that will timeout after 15 seconds if no activity. Why is the pointer *strongSelf = weakSelf created in the block? Is it not okay just to use [weakSelf timeout]? I understood that whenever accessing self in a block we have to use a weak reference, why is another pointer created here? Any help would be great, thank you.