I have had a look at all the comments and I am starting to see what I should be doing. To that end I have modified my code (see below) I have changed new
All the existing answers are leaking the original testPath string. For something as simple as this, why has nobody recommended -[NSMutableString appendString:] intead?
[testPath appendString:@"/"];
There's no equivalent to -stringByAppendingPathComponent: for NSMutableString, but it looks like he's just trying to add a slash, not a path component anyway. If you really wanted to add a path component, you could do this:
[testPath setString:[testPath stringByAppendingPathComponent:@"..."]];
It's an annoying workaround, but as @dreamlax points out, -stringByAppendingPathComponent: always returns an immutable string, even when called on an NSMutableString object. :-(