UIMenuController doesn't re-set UICallbar page state when changing items.

Originator:steipete
Number:rdar://13446855 Date Originated:19-Mar-2013 12:13 AM
Status:Closed Resolved:YES
Product:iOS Product Version:6.1
Classification:Bug Reproducible:Always
 
19-Mar-2013 12:13 AM Peter Steinberger:
Summary:

UIMenuController doesn't re-set UICallbar page state when changing items. When the menu is larger than the screen space, < > arrows will be displayed to split up the content. Press > and go into the second "page" of the callout menu, then select a menu. The submenu is displayed, but it's already at the second page! And the < arrow isn't working. Once you press the > arrow, nothing happens (but internal state of UICalloutBar gets fixed) and then < works again. But obviously, that's not the real fix.

I found two workarounds. The ugly one is

 [menu setMenuVisible:NO animated:YES];

before showing the menu again. But that ruins the fade animation.

The better one is to reset the callout bar state:

        [((id (*)(id, SEL))objc_msgSend)(NSClassFromString(@"UICalloutBar"), NSSelectorFromString(@"activeCalloutBar")) setValue:@"0" forKey:@"m_currentPage"];

But that's unspeakable horrors - so not really usable as well. So please fix this for me, so that http://pspdfkit.com can be better and my customers are happy again :)

Btw, wonder how I found that out? Runtime headers are awesome, and so is Hopper :)

Steps to Reproduce:

I was so nice to make an example, simply start it and follow the instructions above.
So you better not tell me that this is a duplicate :)

Expected Results:

Submenu should start at page 1, not 2.

Notes:

I'm @steipete on Twitter, and I hope some Apple birdies tip me on WWDC 2013 so that I can visit you at the labs again :)

19-Mar-2013 12:13 AM Peter Steinberger:
'UIMenuControllerBug.zip' was successfully uploaded

Comments

Fixed as of iOS7.


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!