VoiceOver causes storyboards to not return a UITableCell properly

Originator:timothy.sanders
Number:rdar://11142652 Date Originated:28-Mar-2012
Status:Duplicate of 10487852 which is closed Resolved:
Product:iPhone SDK Product Version:5.1
Classification:Serious Bug Reproducible:Always
 
28-Mar-2012 04:15 PM Tim Sanders:
Summary:
The "Converting To Storyboards Release Notes" document says dequeueReusableCellWithIdentifier: method is guaranteed to return a cell. This is not true if the end user has VoiceOver on.

"The dequeueReusableCellWithIdentifier: method is guaranteed to return a cell (provided that you have defined a cell with the given identifier). Thus there is no need to use the “check the return value of the method” pattern as was the case in the previous typical implementation of tableView:cellForRowAtIndexPath:."

Steps to Reproduce:

1 ) Build and run the provided sample application.

2 ) With VoiceOver off a prototype cell will be loaded and returned. See the console out log for output like: 

"2012-03-28 15:47:15.619 VoiceOverPrototypeTest[8501:707] dequeue returned <CustomTableCell: 0x1a65b0; baseClass = UITableViewCell".

3 ) Turn on VoiceOver on the device.

4 ) Run the sample application again.

5 ) The dequeue call will return null and you'll see console output more like:

 "2012-03-28 15:48:17.760 VoiceOverPrototypeTest[8520:707] dequeue returned (null)

Assertion failed: (newCell), function -[TableViewController tableView:cellForRowAtIndexPath:], file /Users/tsanders/code/VoiceOverPrototypeTest/VoiceOverPrototypeTest/TableViewController.m, line 39.
"

Expected Results:
dequeue should return a table cell as documented with VoiceOver On and Off. In both cases the code in TableViewController table:cellForRowAtIndexPath: should return a CustomTableCell object and not trigger the assert.


Actual Results:

The sample app behaves correctly with VoiceOver off but will assert with VoiceOver on

Regression:

This was true in both iOS 5.0 and 5.1. While this sample app is iPhone–only I've seen the same thing happen on iPad. Since the simulator doesn't have VoiceOver you have to run on hardware to see the problem. I've tried it both on a current-gen iPod Touch and an iPhone 4S, as well as an iPad 2.

Notes:

As far as I can tell this means table cell prototypes are unusable. For now I've just resorted to older-style code which loads the cell from a nib file if needed.

I believe this is a dupe of at least radar 10675427 and 10550644.

28-Mar-2012 04:15 PM Tim Sanders:
'VoiceOverPrototypeTest.zip' was successfully uploaded

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!