UITests + UIPickerView = EXC_BAD_ACCESS

Hi,

I have a crash performing UITests in an app that displays a UIPickerView.

This crash happens with the latest Xcode (Version 9.2 (9C40b)).

I use the iPhone X 11.2 simulator (but that also happen on my iPhone 6 device or with other simulators)



I've isolated the problem in a sample project that can be downloaded here:

https://www.dropbox.com/s/y7blmt3mgtrhi1a/PickerTest.zip?dl=0



This simple app only adds a UIPickerView as a subview.

The UITests only waits for some predicates to complete (without any actions).

The EXC_BAD_ACCESS appears (after a few seconds) when the app is launched by the UITests.



I've added 3 constants in the ViewController.h file :



#define NUMBER_OF_EXPECTATIONS 10

#define NUMBER_OF_PICKER_ROWS 300

#define NUMBER_OF_PICKER_COMPONENTS 20



According to my tests the crash will appear at a later time (not as soon) if some of those constants are lower.



Does anyone also have this problem ?

Am I doing something wrong, or is it an xcode bug ?

In that case, has anyone got a workaround ?





Thank you 🙂

UITests + UIPickerView = EXC_BAD_ACCESS
 
 
Q