It is casually mentioned here that instance variables have __strong enabled per default – does this mean that having this:
@interface Foo {
Bar *test; // implicitly __strong
}
@property (nonatomic, unsafe_unretained) Bar *test;
@end
and calling
test = [[Bar alloc] init];
in the implementation file, that the new Bar instance will be retained? If yes, will the Bar instance be released at all when Foo is deallocated, considering that the property tells ARC to not touch it?
Did you try compiling that? It won’t work. The ivar associated with a property has to have the same ownership qualifier as the property. This is in the Clang ARC doc:
If you remove the explicit ivar declaration, then the synthesized ivar will be
__unsafe_unretained, like the property.