在下面的代码中有大约 3MB 的泄漏。如果我删除[self.view addSubview:progressDialog];
它们,那么它们就没有泄漏。
-(void)showProgressDialog:(NSString*)title setTimer:(BOOL)isTimerSet
{
progressDialog = [[MBProgressHUD alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
[progressDialog setLabelText:title];
progressDialog.dimBackground=YES;
[self.view addSubview:progressDialog];//Leak is here
[progressDialog show:YES];
}
-(void)hideProgressDialog
{
if(progressDialog !=nil)
{
[progressDialog hide:YES];
[progressDialog removeFromSuperview];
[progressDialog release];
progressDialog = nil;
}
}
请帮忙。