Warning box and operation table (developed for IOS)

Source: Internet
Author: User

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];}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.