Skip to content

Instantly share code, notes, and snippets.

@SeanChense
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeanChense/b4dfb7db4e983e88e963 to your computer and use it in GitHub Desktop.
Save SeanChense/b4dfb7db4e983e88e963 to your computer and use it in GitHub Desktop.
self in block
- (void)doFoo {
__weak typeof(self) weakSelf = self;
[foo handler:^ {
[weakSelf doSomething];
}];
}
- (void)doSomething {
[self doAnotherThing];
}
- (void)doAnotherThing {
//do balabala
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment