BNRItemStore - Array Properties - Memory


#1

I’m a bit confused by the declared properties for:

@property (nonatomic, readonly) NSArray *allItems
@property (nonatomic) NSMutableArray *privateItems

when creating the BNRItemStore. Why are there no attributes for memory management? Any thoughts or explanations are appreciated.

Thanks.


#2

The default for memory management of these objects is strong, so it doesn’t need to be specified. The book is a little inconsistent here because in an earlier chapter I believe it states that it’s good practice to specify this attribute even if you want to use the default. Either way, the declarations mentioned in this post are in fact strong.


#3

Thanks,

Yes, I knew Strong was the default - guess the inconsistency threw me. I started to overthink it … - Thanks again.


#4

[quote=“edgartl”]Thanks,

Yes, I knew Strong was the default - guess the inconsistency threw me. I started to overthink it … - Thanks again.[/quote]

I apologize for the inconsistency. :frowning: The default memory attribute for objects is strong and the default for non-objects is assign.