Let's say I want to create a temporary variable, e.g.:
To point to another long-living variable:
__unsafe_unretained UIView *tableHeaderView = self.tableView.tableHeaderView;
To point to an object I just created.
__unsafe_unretained UIView *tableHeaderView = [[UIView alloc] init];
These temporary variables don't need to be retained because the objects they point to are guaranteed to keep positive retain counts for as long as the temporary variables are in scope. So, should I declare them as __unsafe_unretained
?
No. If ARC retains it, it will let go when the variable goes out of scope.