This code:
__weak VeryCool *weakSelf = self;
something.changeHandler = ^(NSUInteger newIndex) {
if (newIndex == 0) {
[weakSelf.options removeObjectForKey:@"seller"];
}
};
gives me a warning that property options was not found. That’s true, because options is an ivar, but not declared as property. Is it possible to somehow get options from weakSelf without declaring it as property?
For direct ivar access, use
->. For example:It’s important to check that
strongSelfis non-nilbecause direct access to an instance variable will crash for anilpointer (which is different from invoking methods with anilreceiver and property access is just method invocation).