UIMenuController destroys menu items when speak selection is turned on

Originator:invalidname
Number:rdar://13060693 Date Originated:1/22/13
Status:closed; duplicate of 12122187 (Closed) Resolved:
Product:iPad SDK Product Version:6.0.1
Classification:serious bug Reproducible:always
 
22-Jan-2013 10:24 AM Chris Adamson:
Summary:
Turning on Accessibility:Speak Selection from the General settings destroys custom UIMenuItems that have been added to the UIMenuController

Steps to Reproduce:
Run the attached SpeakVersusMenuItems project on an actual iPad device (not the Simulator). This app has a text view with some initial text. In viewDidLoad, it adds three menu items (Item A, Item B, and Item C) which can be accessed by selecting text or long pressing in the text view. When tapped, these items just append a timestamp to the text view. There is also a table at the bottom of the main view that shows the current menu items, as returned from [UIMenuController sharedMenuController].menuItems. There's a reload button next to this table that reloads the local array that serves as the table model.

1. Select some text, press the custom menu items. The text view updates with a timestamp.
2. Long press, press custom menu items. The text view updates with a timestamp.
3. Dismiss the keyboard and tap the reload button. The table continues to show the three menu items (by title and selector string)
4. Leave the app, come back in, do more selecting and menus. Still works as before.
5. Switch to the Settings app and choose General: Accesibility : Speak Selection. Use the switch to turn Speak Selection "ON"
6. Return to SpeakVersusMenuItems.
7. Select a single word. Menus behave as before
8. Use the selection pins to expand the selection, or do a "Select all"

Expected Results:
The app should continue to behave as before

Actual Results:
The custom menu items (Item A, Item B, and Item C) are no longer in the menu once you select more than one word. Tap the reload button and the table will show 0 items. They have literally been deleted from the UIMenuController as a side-effect of turning on Speak Selection.

Regression:

Notes:
We suspect this is a bug, but if this is intended behavior, the app should at least be notified of the loss of the menu items it created, but none of the notifications provided by UIMenuController indicates a change to the menuItems property. We're preparing to set up a background task to poll the number of mediaItems and repopulate if necessary.

22-Jan-2013 10:24 AM Chris Adamson:
'SpeakVersusMenuItems.zip' was successfully uploaded

22-Jan-2013 10:26 AM Chris Adamson:
Attaching an AirPlay recording (SpeakVersusMenuItems-ReflectorRecording-2.mov) that shows the bug in action.

22-Jan-2013 10:26 AM Chris Adamson:
'SpeakVersusMenuItems-ReflectorRecording-2.mov' was successfully uploaded

[OpenRadar: copy of the demo movie at https://dl.dropbox.com/u/12216224/xanedu/SpeakVersusMenuItems-ReflectorRecording-2.mov , at least for the time being]

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!