Я получаю утечку памяти theFileName = [[responseString lastPathComponent]stringByDeletingPathExtension];
theFileName - глобальная переменная.Я синтезировал его и
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]))
{
// Custom initialization
theFileName = [[NSString alloc] init];
}
return self;
}
- (void)requestFinished:(ASIHTTPRequest *)request{
//internally calls this function
// Use when fetching text data
NSString *responseString = [request responseString];
//NSLog(@"the responsestring for download is:%@",responseString);
theFileName = [[responseString lastPathComponent]stringByDeletingPathExtension];
//NSLog(@"the theFileName for download is:%@",theFileName);
//adds extension .jpg to file name
NSString *jpg=@".jpg";
NSString *addjpg=[theFileName stringByAppendingString:jpg];
//NSLog(@"append %@",addjpg);
}
выпустил его в dealloc.
-(void)dealloc
{
[thefileName release];
}
}