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];
    				}
    
  • 相关阅读:
    Days like that:
    获取网站访问来源URL
    论坛里面的一个帖子
    Days like that:
    简单项目布署
    论坛里面的一个帖子
    获取网站访问来源URL
    piwik开放源代码的Web统计软件
    p标签里面不能嵌套div
    IO操作 第二篇 学习(转载)
  • 原文地址:https://www.cnblogs.com/season2009/p/2567542.html
Copyright © 2011-2022 走看看