Let's say I have such a strong property:
@interface Foo
@property (strong, nonatomic) NSArray *myArray;
@end
And in my initializer, I set myArray as follows:
myArray = [NSArray array];
It is safe? Will ARC help keep myArray right for me?
I ask that I have a project in which myArray is not saved properly in this scenario, and I get poor memory access along the way.
But if I use
myArray = [[NSArray alloc] init];
then everything is fine.
source
share