I have a calling method that looks like the following:
-(void)callingMethod
{
NSMutableString *myStr = [[[NSMutableString alloc] initWithCapacity:0] autorelease];
myStr = [self calledMethod];
}
And my called method:
-(NSMutableString*)calledMethod
{
NSMutableString *newStr = [[NSMutableString alloc] initWithCapacity:0];
// do some stuff with newStr
return [newStr autorelease];
}
Am I leaking memory anywhere here? I feel like I'm allocing an unnecessary amount here.