Warning box and operation table (developed for IOS)
When AlertView is in a modal mode, you cannot do other things without closing it. Therefore, it should not be used in any of the following situations.
1. The application cannot continue to run.
If the memory is insufficient, there is no network. Generally, only one button is required.
2. Ask for another solution.
If the instance cannot run, check whether the instance can use a 3G network.
3. Ask for authorization of the operation.
When privacy information is accessed, user authorization is required, such as location and album.
You can select multiple operation tables (ActionSheet. You can use it to send an image to Sina Weibo or Facebook.
/Implement UIAlertViewDelegate // This delegate is not actually used, it should be a trainer, because the warning window has two button indexes/No is 0, Yes is 1-(void) alertView :( UIAlertView *) alertView clickedButtonAtIndex :( NSInteger) buttonIndex {NSLog (@ "buttonIndex = % li", (long) buttonIndex );} // implement UIActionSheetDelegate // This delegate has no practical significance, that is, the number of indexes pressed in the output command window is output to implement response-(void) actionSheet :( UIActionSheet *) actionSheet clickedButtonAtIndex :( NSInteger) buttonIndex {NSLog (@ "buttonIndex = % li", (long) buttonIndex);}-(IBAction) testAlertView :( id) sender {// The warning box is described above. // The delegate parameter is used to set the delegate object UIAlertView * alertView = [[UIAlertView alloc] initWithTitle: @ "Alert" message: @ "Alert text goes here" delegate: self cancelButtonTitle: @ "No" otherButtonTitles: @ "Yes", nil]; [alertView show];}-(IBAction) testActionSheet :( id) sender {// cancelButtonTitle setting cancel title // The destroy setting button can only have one UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle: nil delegate: self cancelButtonTitle: @ "cancel" destructiveButtonTitle: @ "destructive button" otherButtonTitles: @ "Sina Weibo", nil]; // set it to an automatic style actionSheet. actionSheetStyle = UIActionSheetStyleAutomatic; [actionSheet showInView: self. view];}