I\'d like to do a series of string substitutions to removed xml-escaped chars such as \'&\'
.
1) Is there an existing UIKit function that can do thi
Any cocoa method which returns a new object via a method that does not start with init
or contain the word copy
will return an autoreleased object. So the above code should have noleaks.
Although it may be easier to use a NSMutableString here. Then you just modify the string in place rather than creating a pile of autoreleased string objects, which should make things cleaner.
Also, how about a dictionary of mappings that you iterate through, finding the key
and replacing with the value
of each item. Maybe even save this as a plist in your app for easy tweaking later.