zoukankan      html  css  js  c++  java
  • UIActionSheet & UIAlertView

    UIActionSheet *actionSheet = [[UIActionSheet alloc] 
    											  initWithTitle:@"您是否真的要发邮件给他?"
    											  delegate:self 
    											  cancelButtonTitle:@"Cancel" 
    											  destructiveButtonTitle:@"Yes" 
    											  otherButtonTitles:nil];
    				
    				[actionSheet showInView:self.view];
    				[actionSheet release];
    
    - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
    {
    	if (buttonIndex == 0) 
    	{
    		SendMailViewController *detailViewController = [[SendMailViewController alloc] init];
    		detailViewController.emailAddress = [dict objectForKey: @"Email"];
    
    		[[self navigationController] pushViewController:detailViewController animated:YES];
    		[detailViewController release];	
    	}
    }
    
    NSString* webPage =  [dict objectForKey: @"WebPage"];
    				NSURL* url = nil;
    				
    				if ([webPage length] == 0 ) {
    					return;
    				}
    				
    				if( [webPage hasPrefix:@"http://"])
    				{
    					url = [NSURL URLWithString:webPage];
    				}
    				else {
    					NSString* fullWebPage = [NSString stringWithFormat:@"http://%@",webPage];
    					url = [NSURL URLWithString:fullWebPage];
    				}
    				
    				if ([[UIApplication sharedApplication] canOpenURL:url]) {
    					[[UIApplication sharedApplication] openURL:url];
    				}
    				else {
    					UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Cannot open page"
    																	message:@"网址有误,或网络暂时不能访问" 
    																   delegate:nil 
    														  cancelButtonTitle:@"OK" 
    														  otherButtonTitles:nil];
    					[alert show];
    					[alert release];
    				}
    
  • 相关阅读:
    [Hadoop]
    [Linux]
    [Linux]
    [Hadoop]
    [Hadoop]
    vue-学习笔记-API-全局配置
    vue 风格指南-必须的
    vue 学习笔记-复用-自定义指令
    vue学习笔记-过滤器
    vue 学习笔记-复用-对象混入
  • 原文地址:https://www.cnblogs.com/season2009/p/2567542.html
Copyright © 2011-2022 走看看