KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
What happens if I send a message to a weak object? Does sending the message possess the object and hold it in memory until return? I'm thinking of this pattern: __weak MyObject *weakSelf = self; dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf doSomeAction]; }); Assuming weakSelf is non-nil when the message is sent, might it be deallocated while doSomeAction is working or is it guaranteed to remain valid until doSomeAction returns?
Tags (comma-separated)
Save Edits
Cancel