What is the difference between copy and retain for NSString?
copy
retain
NSString
- (void)setString:(NSString*)newString { string = [ne
if you use retain, it copy the pointer value from original one.retain also increment the reference count by one. but in case of copy, it duplicate the data referenced by the pointer and assign it to copy's instance variable.