2013-09-09 2 views
-1

у меня есть вопросы, чтобы использовать UIAlertView с TextFiled в ИОС 7.UIAlertViewStyleSecureTextInput не работает с прошивкой 7

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"title" message:nil delegate:self cancelButtonTitle:@"ok" otherButtonTitles:@"cancel", nil]; 
    alert.alertViewStyle = UIAlertViewStyleSecureTextInput; 
    [[alert textFieldAtIndex:0] setKeyboardType:UIKeyboardTypeNumberPad]; 
    [alert show]; 

, но в новом SDK ИО 7 биговки и Cresh Can-золь, как

AssertMacros: queueEntry, file: /SourceCache/IOKitUser_Sim/IOKitUser-920.1.11/hid.subproj/IOHIDEventQueue.c, line: 512 
2013-09-09 10:39:51.659 Food.de[912:a0b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 1]' 
*** First throw call stack: 
(
    0 CoreFoundation      0x037a16f4 __exceptionPreprocess + 180 
    1 libobjc.A.dylib      0x02cc08b6 objc_exception_throw + 44 
    2 CoreFoundation      0x03742616 -[__NSArrayM objectAtIndex:] + 246 
    3 Food.de        0x0006583f -[HomeViewController addButtonToKeyboard] + 735 
    4 Food.de        0x00065e8e -[HomeViewController keyboardDidShow:] + 238 
    5 Foundation       0x02787089 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke + 40 
    6 CoreFoundation      0x037fd634 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 
    7 CoreFoundation      0x0375513b _CFXNotificationPost + 2859 
    8 Foundation       0x026c0de1 -[NSNotificationCenter postNotificationName:object:userInfo:] + 98 
    9 UIKit        0x01cb8e97 -[UIInputViewTransition postNotificationsForTransitionEnd] + 1054 
    10 UIKit        0x01caf4b8 __53-[UIPeripheralHost(UIKitInternal) executeTransition:]_block_invoke1329 + 455 
    11 UIKit        0x0188dc15 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 306 
    12 UIKit        0x018778bc -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267 
    13 UIKit        0x01877ba4 -[UIViewAnimationState animationDidStop:finished:] + 80 
    14 QuartzCore       0x00cb2e84 _ZN2CA5Layer23run_animation_callbacksEPv + 304 
    15 libdispatch.dylib     0x0316b4b0 _dispatch_client_callout + 14 
    16 libdispatch.dylib     0x03159766 _dispatch_main_queue_callback_4CF + 340 
    17 CoreFoundation      0x03806b6e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14 
    18 CoreFoundation      0x037477eb __CFRunLoopRun + 1963 
    19 CoreFoundation      0x03746bf3 CFRunLoopRunSpecific + 467 
    20 CoreFoundation      0x03746a0b CFRunLoopRunInMode + 123 
    21 GraphicsServices     0x03e8fa27 GSEventRunModal + 192 
    22 GraphicsServices     0x03e8f84e GSEventRun + 104 
    23 UIKit        0x0182bf0b UIApplicationMain + 1225 
    24 Food.de        0x00006c1d main + 141 
    25 Food.de        0x00006b85 start + 53 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
(lldb) 

Если кто-то развивается с ios 7 и знает, как решить эту проблему, тогда помогите.

.....

если alert.alertViewStyle = UIAlertViewStyleSecureTextInput;

мой Xcode версии 5.0 (5A11386k)

не работает с прошивкой 7, то мы используем старую стратегию, как мы делаем для ИОС 5?

спасибо.

+0

Нет, этот вопрос не генерируют UIAlertViewStyleSecureTextInput, UIAlertViewStyleSecureTextInput совершенна работа в Ios 7 , У меня есть использование в моем проекте в Ios 7 – Deepesh

ответ

1

Проблема на вашем HomeViewController. У вас есть

[__NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 1] 

Это означает, что вы пытаетесь получить доступ к индексу, который не существует, я думаю, что на линии 246

+0

ОК, я его решаю .. :) –