ios学习笔记---simpleping

来源:互联网 发布:校园女生暴力数据 编辑:程序博客网 时间:2024/05/29 08:19

下载地址:https://github.com/chrishulbert/SimplePingHelper


只需要把SimplePing.h,SimplePing.m,SimplePingHelper.h,SimplePingHelper.m引入到项目中

//

//  ViewController.m

//  SimplePing

//

//  Created by on 15-3-27.

//  Copyright (c) 2015 rcm. All rights reserved.

//


#import "ViewController.h"

#import "SimplePingHelper.h"

@interface ViewController ()


@end


@implementation ViewController


- (void)viewDidLoad {

    [superviewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.

    NSString *ipAddress = @"192.168.1.20";

    [SimplePingHelper ping:ipAddresstarget:self sel:@selector(pingServerResult:ipAddress:)];

    

    

}

- (void)pingServerResult:(NSNumber*)success ipAddress:(NSString*)ipAddress {

    NSLog(@"pingServerResult: %@ %@", success, ipAddress);

}

- (void)didReceiveMemoryWarning {

    [superdidReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

}


@end


0 0
原创粉丝点击