• tel


    //
    //  JZLTel.m
    //  JZLIntegrationDemo
    //
    //  Created by 微指 on 15/3/16.
    //  Copyright (c) 2015年 JZL. All rights reserved.
    //

    #import "JZLTel.h"

    @implementation JZLTel

    /*

    #pragma mark - 打电话
    -(void)callButtonAction
    {
        
        NSString * phone1 = [self.phones objectAtIndex:0];
        NSString * phone2 = [self.phones objectAtIndex:1];
        NSString * name = self.shopname;
        NSMutableSet * phones = [NSMutableSet set];
        
        if (![phone1 isEqualToString:@""] && phone1) {
            
            [phones addObject:phone1];
        }
        
        if (![phone2 isEqualToString:@""] && phone2) {
            
            [phones addObject:phone2];
        }
        
        NSArray * phonesArray = [phones allObjects];
        if (phonesArray.count>1) {
            
            UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"呼叫"
                                                             message:name
                                                            delegate:self
                                                   cancelButtonTitle:@"取消"
                                                   otherButtonTitles:nil];
            
            alert.tag = 500;
            
            for (int i=0; i<phonesArray.count; i++) {
                
                [alert addButtonWithTitle:[phonesArray objectAtIndex:i]];
            }
            [alert show];
            [alert release];
            
        } else if (phonesArray.count == 1) {
            
            UIWebView *callWebView = [[UIWebView alloc] init];
            NSURL *telURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",[phonesArray objectAtIndex:0]]];
            [callWebView loadRequest:[NSURLRequest requestWithURL:telURL]];
            [self.view addSubview:callWebView];
            [callWebView release];
        }
        
    }

    -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
    {
        if (buttonIndex != 0) {
            
            NSString * title = [alertView buttonTitleAtIndex:buttonIndex];
            NSString * str = [NSString stringWithFormat:@"tel:%@",title];
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
        }
    }
     */

    @end

  • 相关阅读:
    Scrum为什么不喜欢“来自客户的频繁变更”?
    [转]SQL Server计算列
    宽容,是创新的土壤
    【转载】《2010年年度总结》
    远程维护需要“千里眼”
    TOP语句放到表值函数外,效率异常低下
    “设计应对变化”实例讲解一个数据同步系统
    “批量少次”还是“少量多次”邮件通信系统效率浅谈
    NYOJ117 求逆序数
    NYOJ92 图像有用区域
  • 原文地址:https://www.cnblogs.com/jzlblog/p/4342497.html
Copyright © 2020-2023  润新知