gpt4 book ai didi

iphone - 由于内存泄漏导致应用程序崩溃

转载 作者:行者123 更新时间:2023-11-29 04:38:37 24 4
gpt4 key购买 nike

- (void)viewDidLoad {

webCollectionOnScroller=[[NSMutableArray alloc] init];
scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 370, 320, 94)];
scroll.pagingEnabled = YES;
currentWeb=0;
globali=0;
firstTime=0;
[loadingWeb startAnimating];
alertForLoading = [[UIAlertView alloc] initWithTitle:@"Loading..." message:@"link is being loaded.\n Please wait!" delegate:self cancelButtonTitle:@"Back" otherButtonTitles:nil];
[alertForLoading show];
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

// Adjust the indicator so it is up a few pixels from the bottom of the alert
indicator.center = CGPointMake(alertForLoading.bounds.size.width / 2, alertForLoading.bounds.size.height - 100);
[indicator startAnimating];
[alertForLoading addSubview:indicator];
[NSThread detachNewThreadSelector:@selector(initializeParser)toTarget:self withObject:nil];
[super viewDidLoad];
}

这是控制台错误“-[linksGallery respondsToSelector:]: 消息发送到已释放的实例 0x639a890[切换到进程2211]"

当我在主视图上评论发布声明时,它不会崩溃

-(IBAction) goToLinks{
linksGallery *showLinks=[[linksGallery alloc] initWithNibName:@"linksGallery" bundle:nil];
[self.navigationController pushViewController:showLinks animated:YES];
//[showLinks release];
}

最佳答案

尝试首先放置以下行:

[super viewDidLoad];

在“dealloc()”函数内部:

[super dealloc];

在所有版本结束时。

希望对您有所帮助。

关于iphone - 由于内存泄漏导致应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10719343/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com