2015-06-03 3 views
0

У меня возникла проблема, у меня есть опция забытого пароля, в которой я разместил UIAlertView с полем ввода.NSInternalInconsistencyException? Ограничения макета все еще нуждаются в обновлении после отправки

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Forgot Password?" 
                 message:@"Please enter your username to retrieve password" 
                 delegate:self 
               cancelButtonTitle:@"Cancel" 
               otherButtonTitles:@"Ok", nil]; 
    [alertView setAlertViewStyle:UIAlertViewStylePlainTextInput]; 
    [alertView show]; 

Когда приложение запускается, он работает отлично, но когда я войти в систему, сделать все виды вещей, выйти и нажмите «Забыли пароль», я получаю эту ошибку и мое приложение аварии:

*** Завершение приложения из-за неперехваченного исключения «NSInternalInconsistencyException», причина: «Ограничения макета все еще нуждаются в обновлении после отправки -updateConstraints в < _UIKeyboardLayoutAlignmentView: 0x7ffef5b37b00; frame = (0 0; 0 0); userInteractionEnabled = НЕТ; layer =>. _UIKeyboardLayoutAlignmentView или один из его суперклассов может иметь переопределенные-updateConstraints без вызова super. Или что-то может иметь грязные ограничения компоновки в середине их обновления. Оба являются ошибками программирования.

Вот полный лог:

*** First throw call stack: 
(
    0 CoreFoundation      0x000000010e850c65 __exceptionPreprocess + 165 
    1 libobjc.A.dylib      0x000000010e4e9bb7 objc_exception_throw + 45 
    2 CoreFoundation      0x000000010e850b9d +[NSException raise:format:] + 205 
    3 UIKit        0x000000010f2c5427 -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 467 
    4 UIKit        0x000000010f2c553e -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124 
    5 CoreFoundation      0x000000010e757354 CFArrayApplyFunction + 68 
    6 UIKit        0x000000010f2c52ed -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153 
    7 UIKit        0x000000010f2c553e -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124 
    8 CoreFoundation      0x000000010e757354 CFArrayApplyFunction + 68 
    9 UIKit        0x000000010f2c52ed -[UIView(AdditionalLayoutSupport) _internalUpdateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 153 
    10 UIKit        0x000000010f2c553e -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededAccumulatingViewsNeedingSecondPassAndViewsNeedingBaselineUpdate:] + 124 
    11 UIKit        0x000000010f2c5a0e __60-[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded]_block_invoke + 96 
    12 Foundation       0x000000010e0891be -[NSISEngine withBehaviors:performModifications:] + 155 
    13 UIKit        0x000000010f2c56d6 -[UIView(AdditionalLayoutSupport) updateConstraintsIfNeeded] + 231 
    14 UIKit        0x000000010f2b8ebe -[UIWindow(UIConstraintBasedLayout) updateConstraintsIfNeeded] + 91 
    15 UIKit        0x000000010f2c5dde -[UIView(AdditionalLayoutSupport) _updateConstraintsAtEngineLevelIfNeeded] + 146 
    16 UIKit        0x000000010ecbd56a -[UIView(Hierarchy) layoutBelowIfNeeded] + 340 
    17 UIKit        0x000000010f05245e -[_UIAlertControllerAnimatedTransitioning animateTransition:] + 672 
    18 UIKit        0x000000010ed57a4e __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 1867 
    19 UIKit        0x000000010ec6d62c _applyBlockToCFArrayCopiedToStack + 314 
    20 UIKit        0x000000010ec6d4a6 _afterCACommitHandler + 533 
    21 CoreFoundation      0x000000010e783ca7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 
    22 CoreFoundation      0x000000010e783c00 __CFRunLoopDoObservers + 368 
    23 CoreFoundation      0x000000010e779a33 __CFRunLoopRun + 1123 
    24 CoreFoundation      0x000000010e779366 CFRunLoopRunSpecific + 470 
    25 GraphicsServices     0x00000001126c9a3e GSEventRunModal + 161 
    26 UIKit        0x000000010ec49900 UIApplicationMain + 1282 
    27 Univet        0x000000010d83150f main + 111 
    28 libdyld.dylib      0x000000011017a145 start + 1 
    29 ???         0x0000000000000001 0x0 + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 

Я использую IQKeyboardManager для навигации между текстовыми полями.

Обратите внимание, что ваше руководство будет оценено по достоинству.

Заранее спасибо.

ответ

1

После простого поиска Google я обнаружил the answer к вашей проблеме.

На iOS 8.3, если вы показываете клавиатуру, а затем вы пытаетесь отобразить UIAlertView или UIAlertController, у которого есть поле ввода, вы получите этот сбой.

+0

Отлично, большое спасибо, я все еще путаю, почему у меня нет этой ссылки: / –

Смежные вопросы