gpt4 book ai didi

iphone - PSTCollectionView 因 EXC_BAD_ACCESS 崩溃

转载 作者:行者123 更新时间:2023-12-03 17:13:11 25 4
gpt4 key购买 nike

我在我的应用程序中使用 PSTCollectionView。一切都很完美,直到我将 PSTCollectionViewController 的子类添加到 UINavigationController 链中。当我点击导航 Controller 的后退按钮时,应用崩溃并显示 EXC_BAD_ACCESS (code=1, address=0xc0000010)

PS:我使用 ARC。感谢您的帮助。

#0  0x01592d15 in objc_retain ()
#1 0x00030dde in -[PSTCollectionView setDelegate:] at <project_path>/Controllers/PSTCollectionView/PSTCollectionView.m:1225
#2 0x00725596 in -[UIScrollView dealloc] ()
#3 0x00023805 in -[PSTCollectionView dealloc] at <project_path>/Controllers/PSTCollectionView/PSTCollectionView.m:227
#4 0x01592e3d in _objc_rootRelease ()
#5 0x00718b73 in -[UIView(Hierarchy) removeFromSuperview] ()
#6 0x00728563 in -[UIScrollView removeFromSuperview] ()
#7 0x00714c10 in -[UIView dealloc] ()
#8 0x01592e3d in _objc_rootRelease ()
#9 0x01592e00 in objc_release ()
#10 0x01593c50 in (anonymous namespace)::AutoreleasePoolPage::pop(void*) ()
#11 0x01bf2ea8 in _CFAutoreleasePoolPop ()
#12 0x01bf580b in __CFRunLoopRun ()
#13 0x01bf4d84 in CFRunLoopRunSpecific ()
#14 0x01bf4c9b in CFRunLoopRunInMode ()
#15 0x024867d8 in GSEventRunModal ()
#16 0x0248688a in GSEventRun ()
#17 0x006e2626 in UIApplicationMain ()
#18 0x00001f4d in main at <project_path>main.m:16
#19 0x00001e75 in start ()

最佳答案

这似乎与 ARC 相关。我通过更改 PSTCollectionView.m 来修复它,如下所示:

- (void)setDelegate:(id<PSTCollectionViewDelegate>)delegate {
if( !delegate )
return;

//Rest of the function as normal
}

这对我来说没有多大意义,但它有效。

关于iphone - PSTCollectionView 因 EXC_BAD_ACCESS 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15198294/

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