zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    Jmeter之http性能测试实战 非GUI模式压测 NON-GUI模式 结果解析TPS——干货(十一)
    UI Recorder 自动化测试 回归原理(九)
    UI Recorder 自动化测试 录制原理(八)
    UI Recorder 自动化测试 整体架构(七)
    UI Recorder 自动化测试 配置项(六)
    UI Recorder 自动化测试 工具栏使用(五)
    UI Recorder 自动化测试 回归测试(四)
    UI Recorder 自动化测试 录制(三)
    UI Recorder 自动化测试工具安装问题疑难杂症解决(二)
    UI Recorder 自动化测试安装教程(一)
  • 原文地址:https://www.cnblogs.com/jzlblog/p/4342497.html
Copyright © 2011-2022 走看看