gpt4 book ai didi

crash - 在iOS7中[提示显示]导致应用崩溃

转载 作者:行者123 更新时间:2023-12-03 16:18:07 25 4
gpt4 key购买 nike

我在iOS6,iOS5中的代码工作正常,但是在我安装xcode5并在iOS7中运行我的应用程序之后。该应用程序在[alert show]行中崩溃了。错误信息是:线程1:EXC_BAD_ACCESS(代码= 1,地址= 0x3)

我不知道为什么任何人都可以帮助我。谢谢!

我的代码:

- (void) whetherRememberDialog{

dialogFlag = WHETHER_REMEMBER_DIALOG;

NSString *titleInfo = @"Whether remember?";
NSString *cancelInfo = @"cancel";
NSString *okInfo = @"Ok";

UIAlertView *storeQuesitonDialog = [[UIAlertView alloc] initWithTitle:titleInfo
message:nil
delegate:self
cancelButtonTitle:cancelInfo
otherButtonTitles:okInfo, nil];
//[storeQuesitonDialog show];
[storeQuesitonDialog performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:YES]; // In this line the app is crash this codes
[storeQuesitonDialog release];

}

崩溃日志:
* thread #1: tid = 0xa6608, 0x3ac2fb62 libobjc.A.dylib`objc_msgSend + 2, queue = 'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x3)
frame #0: 0x3ac2fb62 libobjc.A.dylib`objc_msgSend + 2
frame #1: 0x330d2ab0 UIKit`-[UIImageView _shouldTreatImageAsTemplate:] + 24
frame #2: 0x330d2a78 UIKit`-[UIImageView _effectiveTintColorWithImage:] + 24
frame #3: 0x330d3980 UIKit`-[UIImageView tintColorDidChange] + 80
frame #4: 0x330ccc2a UIKit`-[UIView(Internal) _recursiveNotifyInteractionTintColorDidChangeForReasons:] + 98
frame #5: 0x330ccce8 UIKit`-[UIView(Internal) _recursiveNotifyInteractionTintColorDidChangeForReasons:] + 288
frame #6: 0x330ccce8 UIKit`-[UIView(Internal) _recursiveNotifyInteractionTintColorDidChangeForReasons:] + 288
frame #7: 0x330ccce8 UIKit`-[UIView(Internal) _recursiveNotifyInteractionTintColorDidChangeForReasons:] + 288
frame #8: 0x330ccce8 UIKit`-[UIView(Internal) _recursiveNotifyInteractionTintColorDidChangeForReasons:] + 288
frame #9: 0x330ccce8 UIKit`-[UIView(Internal) _recursiveNotifyInteractionTintColorDidChangeForReasons:] + 288
frame #10: 0x330ccce8 UIKit`-[UIView(Internal) _recursiveNotifyInteractionTintColorDidChangeForReasons:] + 288
frame #11: 0x330ccce8 UIKit`-[UIView(Internal) _recursiveNotifyInteractionTintColorDidChangeForReasons:] + 288
frame #12: 0x330ccce8 UIKit`-[UIView(Internal) _recursiveNotifyInteractionTintColorDidChangeForReasons:] + 288
frame #13: 0x330ccce8 UIKit`-[UIView(Internal) _recursiveNotifyInteractionTintColorDidChangeForReasons:] + 288
frame #14: 0x332d60ea UIKit`-[_UIModalItemsPresentingViewController _desaturateUI] + 210
frame #15: 0x332d18f0 UIKit`-[_UIModalItemsPresentingViewController _dismissItem:andPresentItem:animated:completion:keepDimmingView:] + 416
frame #16: 0x332d174a UIKit`-[_UIModalItemsPresentingViewController _dismissItem:andPresentItem:animated:completion:] + 38
frame #17: 0x332d0f6e UIKit`-[_UIModalItemsCoordinator _presentItem:replacingItem:inViewController:animated:] + 1198
frame #18: 0x332d0aa8 UIKit`-[UIViewController(UIModalItemPresentationSupport) presentModalItem:replacing:animated:dontPresentAndAddToStack:] + 120
frame #19: 0x332d0a2c UIKit`-[UIViewController(UIModalItemPresentationSupport) presentModalItem:animated:] + 32
frame #20: 0x332cf77c UIKit`-[UIAlertView(Private) popupAlertAnimated:animationType:atOffset:] + 968
frame #21: 0x332cf3ae UIKit`-[UIAlertView(Private) popupAlertAnimated:animationType:] + 34
frame #22: 0x3126f19c Foundation`-[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 744
frame #23: 0x31272b54 Foundation`-[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 136
frame #24: 0x000dd7f0 PPExam`-[ExamPageViewController whetherRememberDialog](self=0x16e9c930, _cmd=0x001fa7ec) + 316 at ExamPageViewController.m:1043
frame #25: 0x000dbbb8 PPExam`-[ExamPageViewController backToChapterNaviController:](self=0x16e9c930, _cmd=0x001fa802, sender=0x16ea5870) + 68 at ExamPageViewController.m:743
frame #26: 0x330f555e UIKit`-[UIApplication sendAction:to:from:forEvent:] + 90
frame #27: 0x330f54fa UIKit`-[UIApplication sendAction:toTarget:fromSender:forEvent:] + 38
frame #28: 0x330f54ca UIKit`-[UIControl sendAction:to:forEvent:] + 46
frame #29: 0x330e10f2 UIKit`-[UIControl _sendActionsForEvents:withEvent:] + 374
frame #30: 0x330f4f12 UIKit`-[UIControl touchesEnded:withEvent:] + 594
frame #31: 0x330f4bdc UIKit`-[UIWindow _sendTouchesForEvent:] + 528
frame #32: 0x330efc08 UIKit`-[UIWindow sendEvent:] + 832
frame #33: 0x330c4f58 UIKit`-[UIApplication sendEvent:] + 196
frame #34: 0x330c3746 UIKit`_UIApplicationHandleEventQueue + 7114
frame #35: 0x30905f26 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
frame #36: 0x309053ee CoreFoundation`__CFRunLoopDoSources0 + 206
frame #37: 0x30903bde CoreFoundation`__CFRunLoopRun + 630
frame #38: 0x3086e540 CoreFoundation`CFRunLoopRunSpecific + 524
frame #39: 0x3086e322 CoreFoundation`CFRunLoopRunInMode + 106
frame #40: 0x355a52ea GraphicsServices`GSEventRunModal + 138
frame #41: 0x331251e4 UIKit`UIApplicationMain + 1136
frame #42: 0x000b6ce0 PPExam`main(argc=1, argv=0x27d51c7c) + 100 at main.m:14

最佳答案

由于ARC,您无法在iOS 7中手动释放对象。 ARC为您管理对象的重新分配,因此您不应释放对象。这可能会导致ARC在完成操作后释放对象,从而引发错误。另外,如果您释放警报 View ,它应该如何显示在屏幕上?删除发行版可能会为您解决此问题。

关于crash - 在iOS7中[提示显示]导致应用崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19683949/

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