gpt4 book ai didi

objective-c - 对象泄露 : Object allocated and stored is not referenced later in this execution

转载 作者:行者123 更新时间:2023-11-28 17:59:50 25 4
gpt4 key购买 nike

使用分析工具后,我收到以下警告“对象泄漏:在此执行中稍后未引用分配和存储的对象”

enter image description here

如何删除此警告?

最佳答案

在 IF block 内,您重新分配 UIWebView 而无需使用初始分配。取而代之的是这样的东西......

UIWebView *videoView = nil;

if([self.webViewCache objectForKey:cellId]) {
videoView = .....normal code here
} else {
videoView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 104, 104)];
.... normal code here
}

关于objective-c - 对象泄露 : Object allocated and stored is not referenced later in this execution,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8988244/

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