I have noticed, that even that my code is working great, something strange happen.
Assume I have two arrays: passwordEntered and tempPasswordEntered.
After I get a new passwordEntered, I do this each time:
tempPasswordEntered=[passwordEntered mutableCopy];
Then I clean :
[passwordEntered removeAllObjects];
then, next time I again do this (for the new passwordEntered):
tempPasswordEntered=[passwordEntered mutableCopy];
So tempPasswordEntered has only the last passwordEntered, and not both of them.
if first time it had 4 places in array,the second time it still has 4 places,
so my question is, does the copy REPLACE the array ? its not added to the last place of it as when you addObject ?
Another thing: should I use retain instead?
The latter two are simple leaks. The first is one way of making a copy, but retVal = [fetchResults copy]; is a better way to make a copy.
But, of course, you don’t need a copy at all. That isn’t the problem. You go on to say that the only thing that doesn’t crash is an empty result set.
That indicates one of two things; either your result set is corrupt (unlikely) or you are accessing the result set incorrectly (likely).