문제

I'm pretty new to iPhone dev, so any help is appreciated.

I am creating an action sheet within a function and adding it to the current view. I have the sheet delegate as 'self' and the action sheet is not retained. Is there a function like the datePicker's didSelectRow? Something like "didDismissWithButtonAtIndex" or something that lets me detect when an action sheet is closing?

Thanks, Mike

도움이 되었습니까?

해결책

The UIActionSheetDelegate method – actionSheet:didDismissWithButtonIndex: is what you're looking for. From the documentation:

actionSheet:didDismissWithButtonIndex:

Sent to the delegate after an action sheet is dismissed from the screen.

- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex

Parameters
actionSheet
The action sheet that was dismissed.

buttonIndex
The index of the button that was clicked. The button indices start at 0. If this is the cancel button index, the action sheet is canceling. If -1, the cancel button index is not set.

Discussion
This method is invoked after the animation ends and the view is hidden.

다른 팁

NSLog(@"actionsheetvisible %@", actionSheet.isVisible?@"YES":@"NO");

Use the isVisible property.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top