gpt4 book ai didi

ios - UIScrollView _delegateScrollViewAnimationEnded 崩溃

转载 作者:行者123 更新时间:2023-12-01 16:30:14 25 4
gpt4 key购买 nike

我在 UIScrollView 中看到崩溃,因为在 scrollView 完成动画之前委托(delegate)已从内存中释放。

我知道这是原因,解决方案应该是在 UIScrollView 的委托(delegate)遇到自己的 dealloc 调用时手动取消委托(delegate)。我已经对我能找到的每个具有 UIScrollView subview 的 viewController 执行了此操作,但崩溃仍然存在。我知道根本原因是 UIScrollView 的委托(delegate)是分配而不是弱,我很好奇我是否可以以某种方式覆盖它(通过类别?)。

还有其他解决方案吗?

这是崩溃的转储,我觉得奇怪的是堆栈上的一个调用引用了 UITextView(它继承自 UIScrollView),这是否可以提供有关有问题的 UIScrollView 位置的线索?

Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xc1a9e521
0 libobjc.A.dylib objc_msgSend + 5 respondsToSelector:
1 UIKit -[UIScrollView(UIScrollViewInternal) _delegateScrollViewAnimationEnded] + 52
2 UIKit -[UIScrollView(UIScrollViewInternal) _scrollViewAnimationEnded:finished:] + 184
3 UIKit -[UITextView _scrollViewAnimationEnded:finished:] + 306
4 UIKit -[UIAnimator stopAnimation:] + 476
5 UIKit -[UIAnimator(Static) _advanceAnimationsOfType:withTimestamp:] + 304
6 UIKit -[UIAnimator(Static) _LCDHeartbeatCallback:] + 52
7 QuartzCore CA::Display::DisplayLinkItem::dispatch() + 98
8 QuartzCore CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 366
9 IOMobileFramebuffer IOMobileFramebufferVsyncNotifyFunc + 90
10 IOKit IODispatchCalloutFromCFMessage + 256
11 CoreFoundation __CFMachPortPerform + 132
18 UIKit UIApplicationMain + 1440

最佳答案

这可能与以下问题相同。
基本设置UIScrollViewdelegatenildealloc
Unable to find reason for Crash on -[UIScrollView(UIScrollViewInternal) _scrollViewAnimationEnded:finished:]

关于ios - UIScrollView _delegateScrollViewAnimationEnded 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32101678/

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