Multiple UIActionSheets on the same delegate

后端 未结 3 491
梦如初夏
梦如初夏 2021-02-10 13:53

I\'m writing a puzzle game. When the user presses the check button, I see if the solution they entered is correct. Depending on the result, I present one of two action sheets fo

3条回答
  •  难免孤独
    2021-02-10 14:38

    The methods that will be called by a UIActionSheet on its delegate are the methods listed in the UIActionSheetDelegate protocol.

    http://developer.apple.com/library/ios/#documentation/uikit/reference/UIModalViewDelegate_Protocol/UIActionSheetDelegate/UIActionSheetDelegate.html

    To be called, your method must be one of those methods. I don't see levelCompleteActionSheet or showErrorsActionSheet listed in that protocol! :) Your method must be named actionSheet:clickedButtonAtIndex:, and not some name you make up out of whole cloth.

提交回复
热议问题