[I'm sure this is not odd at all, but I need just a bit of help]
I have two retain
properties
@property (nonatomic, retain) NSArray *listContent;
@property (nonatomic, retain) NSArray *filteredListContent;
and in the viewDidLoad
method I set the second equal to the first (so now the retainCount is two, I think):
self.filteredListContent = self.listContent;
and then on every search I do this
self.filteredListContent = [listContent filteredArrayUsingPredicate:predicate];
I thought I should do a release
right above this assignment -- since the property should cause an extra retain, right? -- but that causes the program to explode the second time I run the search method. The retain counts (without the extra release
) are 2 the first time I come into the search method, and 1 each subsequent time (which is what I expected, unfortunately).
Some guidance would help, thanks! Is it correct to not release?