Hi,
I'm looking for a good way to return a string constructed by a NSMutableString avoiding leaking :
eg:
+(NSString *)myMethod{
NSMutableString *numberToReturn = [[NSMutableString alloc] init];
[numberToReturn appendString:@"lorem ipsum"];
return numberToReturn;
}
The leak instrument said I had leak with this variable.
I tried autorelease but it crashes I tried to return a copy or copying the mutablestring into a nsstring but leak still present.
Any idea or trick? I'have a to call this method each time the user type a value into the textfield, so the application crashes due to bad memory management...
thank you