I want to when should we use NSString and when should we use the NSMutableString, because we can append the string in NSString also,so what is the effective use of NSMutableString in Objective C programming?
I want to when should we use NSString and when should we use the
Share
I expect MutableString will be slightly more efficient in terms of memory as you are indicating early on that the program may need memory dynamically. NSString is likely to be allocated a single, suitably sized block of memory.
With NSString and its
stringBy...methods, you are creating new objects, releasing the old one (if need be) and making the new object autorelease. (Take care if you are changing from non-autorelease to autorelease, you may have a release in your dealloc that isn’t needed anymore)