This is probably a question that is more about object alloc/retain/release, but I'll use NSString as an example. I'm aware that I can do:
NSString* myString = [[NSString alloc] initWithString:@"Test"];
to essentially allocate and initialize a string referenced by my variable myString which I should later call [myString release] upon. However, if after I do this, I set it to some other string such as:
myString = someOtherString;
does that essentially create a memory leak because I've reassigned my pointer to another object and lost all reference to the original one I allocated?
If I simply want to personally allocate and release a string and then change its value at various times, should I be using a different syntax other than '=' or is that overloaded to properly change the contents of the object that is originally represented by myString when I use =.