在XCode 6.1调试器下运行时,UIAlertController崩溃

时间:2015-01-24 17:29:25

标签: xcode6.1 ios8.1 uialertcontroller

我的iPad应用程序(XCode 6.1.1,iOS 8.1.1,ARC,Storyboards)在验证用户想要删除记录时发出此代码:

//  create an action sheet
UIAlertController *view=   [UIAlertController
                             alertControllerWithTitle:@"Warning!"
                             message:NSLocalizedString(@"Are you sure you want to delete this appointment?",nil)
                             preferredStyle:UIAlertControllerStyleActionSheet];

UIAlertAction* yes = [UIAlertAction
                      actionWithTitle:@"Yes"
                      style:UIAlertActionStyleDefault
                      handler:^(UIAlertAction * action)
                      {
                          [self deleteSingleAppointment];
                          [view dismissViewControllerAnimated:YES completion:nil];

                      }];
UIAlertAction* no = [UIAlertAction
                     actionWithTitle:@"No"
                     style:UIAlertActionStyleDefault
                     handler:^(UIAlertAction * action)
                     {
                         //Do some thing here
                         [view dismissViewControllerAnimated:YES completion:nil];

                     }];

[view addAction:yes];
[view addAction:no];

view.popoverPresentationController.sourceView = self.view;
view.popoverPresentationController.sourceRect = CGRectMake(self.view.bounds.size.width / 2.0, self.view.bounds.size.height / 2.0, 1.0, 1.0);
[self presentViewController: view animated:YES completion:nil];

当我在设备上的调试器外运行时,此代码运行正常;这是显示的错误,堆栈跟踪如下:

enter image description here

更新以下是来自'bt'的“堆栈跟踪”:

  

(lldb)bt   * thread#1:tid = 0x14e4ec,0x0000000111437dd2 CoreFoundation CFArrayGetValueAtIndex + 130, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x0000000111437dd2 CoreFoundation CFArrayGetValueAtIndex + 130       帧#1:0x00000001137461af CoreText TCharStream::CopyBreakIterator(__CFString const*) + 251 frame #2: 0x0000000113745f7e CoreText TCharStream :: FindLineBreak(CFRange,bool,__ CFString const *)const + 274       帧#3:0x00000001136cde9c CoreText TTypesetter::SuggestLineBreak(TLine const&, long, double, double) + 290 frame #4: 0x00000001136cdb52 CoreText CTLineSuggestLineBreakWithOffset + 20       帧#5:0x000000011a6158f3 UIFoundation __NSStringDrawingEngine + 19550 frame #6: 0x000000011a610c6f UIFoundation - [NSString(NSExtendedStringDrawing)boundingRectWithSize:options:attributes:context:] + 198       帧#7:0x000000010faa0305 UIKit -[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 1025 frame #8: 0x000000010fa9fda0 UIKit - [UILabel textRectForBounds:limitedToNumberOfLines:] + 76       帧#9:0x000000010faa3852 UIKit -[UILabel _intrinsicSizeWithinSize:] + 170 frame #10: 0x000000010faa3932 UIKit - [UILabel intrinsicContentSize] + 76       帧#11:0x000000010ff59ea4 UIKit -[UIView(UIConstraintBasedLayout) _generateContentSizeConstraints] + 33 frame #12: 0x000000010ff59c64 UIKit - [UIView(UIConstraintBasedLayout)_updateContentSizeConstraints] + 422       帧#13:0x000000010ff610d6 UIKit -[UIView(AdditionalLayoutSupport) updateConstraints] + 163 frame #14: 0x000000010faa379d UIKit - [UILabel updateConstraints] + 272       帧#15:0x000000010ff606fa UIKit -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 248 frame #16: 0x000000010ff608f2 UIKit - [UIView(AdditionalLayoutSupport)_updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124       帧#17:0x0000000111455194 CoreFoundation CFArrayApplyFunction + 68 frame #18: 0x000000010ff6069b UIKit - [UIView(AdditionalLayoutSupport)_internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153       帧#19:0x000000010ff608f2 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124 frame #20: 0x0000000111455194 CoreFoundation CFArrayApplyFunction + 68       帧#21:0x000000010ff6069b UIKit -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153 frame #22: 0x000000010ff608f2 UIKit - [UIView(AdditionalLayoutSupport)_updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124       帧#23:0x0000000111455194 CoreFoundation CFArrayApplyFunction + 68 frame #24: 0x000000010ff6069b UIKit - [UIView(AdditionalLayoutSupport)_internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153       帧#25:0x000000010ff608f2 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124 frame #26: 0x0000000111455194 CoreFoundation CFArrayApplyFunction + 68       帧#27:0x000000010ff6069b UIKit -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153 frame #28: 0x000000010ff608f2 UIKit - [UIView(AdditionalLayoutSupport)_updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124       帧#29:0x0000000111455194 CoreFoundation CFArrayApplyFunction + 68 frame #30: 0x000000010ff6069b UIKit - [UIView(AdditionalLayoutSupport)_internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153       帧#31:0x000000010ff608f2 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124 frame #32: 0x0000000111455194 CoreFoundation CFArrayApplyFunction + 68       帧#33:0x000000010ff6069b UIKit -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153 frame #34: 0x000000010ff608f2 UIKit - [UIView(AdditionalLayoutSupport)_updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124       帧#35:0x0000000111455194 CoreFoundation CFArrayApplyFunction + 68 frame #36: 0x000000010ff6069b UIKit - [UIView(AdditionalLayoutSupport)_internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153       帧#37:0x000000010ff608f2 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124 frame #38: 0x0000000111455194 CoreFoundation CFArrayApplyFunction + 68       帧#39:0x000000010ff6069b UIKit -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153 frame #40: 0x000000010ff608f2 UIKit - [UIView(AdditionalLayoutSupport)_updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124       帧#41:0x0000000111455194 CoreFoundation CFArrayApplyFunction + 68 frame #42: 0x000000010ff6069b UIKit - [UIView(AdditionalLayoutSupport)_internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153       帧#43:0x000000010ff608f2 UIKit -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124 frame #44: 0x0000000111455194 CoreFoundation CFArrayApplyFunction + 68       帧#45:0x000000010ff6069b UIKit -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153 frame #46: 0x000000010ff608f2 UIKit - [UIView(AdditionalLayoutSupport)_updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124       帧#47:0x000000010edcbd6e基础-[NSISEngine withBehaviors:performModifications:] + 155 frame #48: 0x000000010ff60bd4 UIKit - [UIView(AdditionalLayoutSupport)updateConstraintsIfNeeded] + 565       帧#49:0x000000010ff541e0 UIKit -[UIWindow(UIConstraintBasedLayout) updateConstraintsIfNeeded] + 91 frame #50: 0x000000010ff6119e UIKit - [UIView(AdditionalLayoutSupport)_updateConstraintsAtEngineLevelIfNeeded] + 159       帧#51:0x000000010f947b2d UIKit -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 114 frame #52: 0x000000010f953973 UIKit - [UIView(CALayerDelegate)layoutSublayersOfLayer:] + 521       帧#53:0x000000010f626de8 QuartzCore -[CALayer layoutSublayers] + 150 frame #54: 0x000000010f61ba0e QuartzCore CA :: Layer :: layout_if_needed(CA :: Transaction *)+ 380       帧#55:0x000000010f61b87e QuartzCore CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 24 frame #56: 0x000000010f58963e QuartzCore CA :: Context :: commit_transaction(CA :: Transaction *)+ 242       帧#57:0x000000010f58a74a QuartzCore CA::Transaction::commit() + 390 frame #58: 0x000000010f58adb5 QuartzCore CA :: Transaction :: observer_callback(__ CFRunLoopObserver *,unsigned long,void *)+ 89       帧#59:0x0000000111481dc7 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 frame #60: 0x0000000111481d20 CoreFoundation __ CFRunLoopDoObservers + 368       帧#61:0x0000000111477b53 CoreFoundation __CFRunLoopRun + 1123 frame #62: 0x0000000111477486 CoreFoundation CFRunLoopRunSpecific + 470       帧#63:0x00000001122de9f0 GraphicsServices GSEventRunModal + 161 frame #64: 0x000000010f8da420 UIKit UIApplicationMain + 1282     *帧#65:0x000000010ddba9a3 SalonBook main(argc=3, argv=0x00007fff51e46488) + 115 at main.m:15 frame #66: 0x000000011100d145 libdyld.dylib开始+ 1   (lldb)

我重新启动了Mac,但它仍然会发生。知道是什么导致了这个吗?

0 个答案:

没有答案