13

We receive some reports for crashes in UIWebSelectSinglePicker. We guess it's due to an empty datasource array. This occurs in a webview though. How can we work around this? would prefer a native only solution

edit

happens only on iphones, running both iOS7 and iOS8

1   CoreFoundation  __exceptionPreprocess + 127
2   libobjc.A.dylib objc_exception_throw + 36
3   CoreFoundation  -[__NSArrayM objectAtIndex:] + 228
4   UIKit   -[UIWebSelectSinglePicker pickerView:didSelectRow:inComponent:] + 56
5   UIKit   -[UIPickerView _sendSelectionChangedForComponent:notify:] + 90
6   UIKit   -[UIPickerTableView _scrollingFinished] + 152
7   UIKit   -[UIScrollView(UIScrollViewInternal) _stopScrollDecelerationNotify:] + 842
8   UIKit   -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:tramplingDragFlags:] + 502
9   UIKit   -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:pin:] + 28
10  UIKit   -[UIScrollView _smoothScrollWithUpdateTime:] + 208
11  QuartzCore  CA::Display::DisplayLinkItem::dispatch() + 96
12  QuartzCore  CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 364
13  IOMobileFramebuffer IOMobileFramebufferVsyncNotifyFunc + 88
14  IOKit   IODispatchCalloutFromCFMessage + 254
15  CoreFoundation  __CFMachPortPerform + 130
16  CoreFoundation  __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
17  CoreFoundation  __CFRunLoopDoSource1 + 344
18  CoreFoundation  __CFRunLoopRun + 1606
19  CoreFoundation  CFRunLoopRunSpecific + 474
20  CoreFoundation  CFRunLoopRunInMode + 104
21  GraphicsServices    GSEventRunModal + 134
22  UIKit   UIApplicationMain + 1438
23  MYAPP   main (main.m:16)
24  libdyld.dylib   start + 0
tzl
  • 1,540
  • 2
  • 20
  • 31
  • Could you supply some more code, it's hard to tell what the problem is simply from the debug output. although the ultimate issue does appear to be with an nsmutablearray somewhere.. – Micaiah Wallace Apr 22 '15 at 14:14
  • there isn't much code to provide. we are just loading a url in a webview – tzl Apr 23 '15 at 04:48
  • I have seen a lot of crashes with – Dalzhim Apr 24 '15 at 05:30
  • hi we've got that crash too and worked around it already. this one happens on iphones only. – tzl Apr 24 '15 at 07:12
  • Just chiming in to say I have received this same crash in 2019 on iOS 12.3.1 on an iPhone 7 – Paul Bruneau Jun 25 '19 at 12:48

2 Answers2

2

I would guess this is related to another issue here on SO

There is an issue with the WebView and system controls triggered from HTML.

Community
  • 1
  • 1
dogsgod
  • 6,267
  • 6
  • 25
  • 53
  • we've got that crash and fixed it with the solution provided in that question. this particular crash occurs only on iphones, on both iOS 7 and iOS8 – tzl Apr 24 '15 at 07:12
0

I think there is no link with UIWebSelectSinglePicker. I think you are trying to access to an object at an index outside the range of your array.

To prevent this you can add something like:

if(index < [self.myArray count] && [self.myArray count] > 0){
     id myobject = [self.myArray objectAtIndex:index];
     // do what you want here with your object
}

To debug this kind of issue and find where it happens, try to add a symbolic breakpoint:

  1. Select the breakpoint navigator
  2. click on "+"
  3. "add symbolic breakpoint"
  4. add "objectAtIndex" in the symbol field
Y.Bonafons
  • 2,329
  • 13
  • 20