Tuesday, May 8, 2012

NSMutableString as retain/copy


I have aa number of NSMutableString's in my app (almost 10-11); all defined as ivar/property




@property (nonatomic, retain) NSMutableString *str1;



I read somewhere that it is better to use "copy" for strings. Is that true? If yes, can I just replace retain to copy in my app and remove the release in dealloc ?



Do I need to consider some other things as well ?



Also, is it normal to have 10-11 NSMutableString's in 1 app..I mean from memory usage perspective ? I also have 4-5 NSMutableDictionary's as well in my app. Please let me know if that is fine.


Source: Tips4all

No comments:

Post a Comment