Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS夯实:ARC时代的内存管理中的[self someMethod]; #1

Closed
maxfong opened this issue May 23, 2015 · 1 comment
Closed

iOS夯实:ARC时代的内存管理中的[self someMethod]; #1

maxfong opened this issue May 23, 2015 · 1 comment

Comments

@maxfong
Copy link

maxfong commented May 23, 2015

__weak SomeObjectClass *weakSelf = self;

SomeBlockType someBlock = ^{
SomeObjectClass *strongSelf = weakSelf;
if (strongSelf == nil) {
// The original self doesn't exist anymore.
// Ignore, notify or otherwise handle this case.
}
[self someMethod];
};
确定是[self someMethod];?

@100mango
Copy link
Owner

应为[strongSelf someMethod];
感谢指出,已修改。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants