I have a UITextField called txtvwEmail. i am adding the text from txtvwEmail.text to the Array pastUrls but after adding the next text it remove the first text. Im using the code
if (![pastUrls containsObject:txtvwEmail.text]) {
[pastUrls addObject:txtvwEmail.text];
}
You should rely on the basics of the language and frameworks. The array DOES RETAIN the object, however, it could be:
count is yet the same
Also, you can’t really be sure [obj retainCount] return the correct value. To diagnose the real problem, revise the code or post it here so we can help.