On Oct 2, 2013, at 11:49 PM, Markus Spoettl <ms_li...@shiftoption.com> wrote:
> On 10/2/13 10:40 PM, David Duncan wrote: >> On Oct 2, 2013, at 9:33 AM, Markus Spoettl <ms_li...@shiftoption.com> wrote: >> >>> On the iPad (both device and simulator) this produces a sheet with >>> "Button2" missing. No matter how many buttons one adds, the last one added >>> goes missing. >>> >>> On iPhone (again both device and simulator) this produces a sheet with the >>> expected buttons "Cancel", "Button1", "Button2". >>> >>> If I set the cancelButtonTitle: parameter to nil, both iPad and iPhone >>> behave correctly, iow "Button1", "Button2". >> >> >> Try setting the cancelButtonIndex after you’ve added the extra buttons. The >> safest way to do this would be to stash off the number of buttons after >> you’ve created it (via numberOfButtons) then add your extra buttons, then >> reset the cancelButtonIndex based on the stashed value. -- David Duncan > > Thanks Duncan, I will try that. However, as Fritz pointed out, the HIG says > cancel buttons are undesireable, so I guess the easiest solution is to do > that. When displaying an action sheet as a popover, the action sheet will automatically remove the cancel button, so you shouldn’t need to do that yourself (in fact I would recommend against it). Thinking a bit about this you may want to use canceledItemIndex instead of numberOfButtons, but either way its something to try. -- David Duncan _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com