0

我对 ios 4.2.1 和 uidatepicker 有疑问。我的应用程序在 iPad 上运行,选择器位于 UIPopoverController 内。在 iOS 3.2 上,该应用程序运行良好。当我旋转选择器的任何轮子时,应用程序会因此堆栈跟踪而崩溃:

* 由于未捕获的异常“NSRangeException”而终止应用程序,原因:“-[NSMutableArray objectAtIndex:]: index 2147483647 beyond bounds [0 .. 2]' * * 第一次抛出调用堆栈:( 0 CoreFoundation 0x01165be9exceptionPreprocess + 185 1 libobjc.A.dylib 0x012ba5c2 objc_exception_throw + 47 2 CoreFoundation 0x0115b6e5 -[__NSArrayM objectAtIndex:] + 261 3 UIKit 0x002e9b74 -[UIPickerView reloadComponent:] + 62 4 UIKit 0x004cb6a9 -[UIDatePickerView _updateDateOrTime] + 1273 5 UIKit 0x004cb114 -[ UIDatePickerView pickerView:didSelectRow:inComponent:] + 42 6 UIKit 0x002e9194 -[UIPickerView _sendSelectionChangedForComponent:] + 100 7 UIKit 0x002e8f75 -[UIPickerView scrollerDidEndSmoothScrolling:] + 75 8 UIKit 0x004924c7 -[UIScroller(Internal)::_stop] + 692 9 UIKit 0x00493ed0 -[UIScroller(Static) _smoothScroll:] + 4743 10 UIKit 0x0048a188 ScrollerHeartbeatCallback + 129 11 GraphicsServices 0x01a9d447 HeartbeatTimerCallback + 35 12 CoreFoundation 0x01146fe3 __CFRUN_ALLOOP_TIMERCALLBACK_F_TOUNCIL_CALL_C+ 19 13 CoreFoundation 0x01148594 __CFRunLoopDoTimer + 1220 14 CoreFoundation 0x010a4cc9 __CFRunLoopRun + 1817 15 CoreFoundation 0x010a4240 CFRunLoopRunSpecific + 208 16 CoreFoundation 0x010a4161 CFRunLoopRunInMode + 97 17 GraphicsServices 0x01a9a268 GSEventRunModal + 217 18 GraphicsServices 0x01a9a32d GSEventRun + 115 19 UIKit 0x0030242e UIApplicationMain + 1160 20 Agenda 0x0000245c main + 102 21 Agenda 0x000023ed start + 53 ) 在抛出“NSException”实例后调用终止程序接收到的信号:“SIGABRT”。

有任何想法吗?

4

1 回答 1

1

问题在于您的数组范围。

于 2011-01-20T10:46:27.737 回答