Is it valid to use the __weak
storage modifier in a method's implementation's signature? Especially if it is not part of the method's public signature? For example:
- (UIView *)tableView:(__weak UITableView *)tableView viewForHeaderInSection:(NSInteger)sectionIndex
{
UIView *view = [ABHeaderView view];
view.actionBlock = ^{
[tableView doSomething];
}
// ...
return view;
}
Does this correctly use tableView
as a weak pointer? Or should I really do something like __weak *weakTableView = tableView;
and use weakTableView
within the block?
I do not get any warnings or errors and the clang Static Analyzer does not throw any warnings.