iOS?????????????ASI?????????????
???????????? ???????[ 2015/7/3 13:59:00 ] ??????????????? ????
???????????????е????
????????????????2????
1 #import "YYViewController.h"
2 #import "ASIHTTPRequest.h"
3
4 @interface YYViewController ()
5
6
7 @end
8
9 @implementation YYViewController
10
11 - (void)viewDidLoad
12 {
13 [super viewDidLoad];
14 }
15
16 -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
17 {
18 //???????????????
19 [self download1];
20 }
21
22 #pragma mark-???????
23 //???1
24 -(void)download
25 { //1.???????????
26 NSURL *url=[NSURL URLWithString:@"http://127.0.0.1:8080/MJServer/resources/video.zip"];
27 ASIHTTPRequest *request=[ASIHTTPRequest requestWithURL:url];
28
29 //2.???????????????????е??????
30 [request setDataReceivedBlock:^(NSData *data) {
31 NSLog(@"%d"??data.length);
32 }];
33
34 //3.??????????????
35 [request startAsynchronous];
36 }
37
38 //???2
39 -(void)download1
40 {
41 //1.???????????
42 NSURL *url=[NSURL URLWithString:@"http://127.0.0.1:8080/MJServer/resources/video.zip"];
43 ASIHTTPRequest *request=[ASIHTTPRequest requestWithURL:url];
44
45 //2.????????????????·??
46 NSString *cachepath=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory?? NSUserDomainMask?? YES)lastObject];
47 NSString *filename=[cachepath stringByAppendingPathComponent:@"video.zip"];
48 request.downloadDestinationPath=filename;
49 NSLog(@"%@"??filename);
50
51 //3.????????????????
52 [request startAsynchronous];
53
54 //4.????????????
55 [request setCompletionBlock:^{
56 NSLog(@"??????");
57 }];
58 }
59
60 @end
????????????
?????????????
??????????????????????asi??????????????????????????????????????????輴?????????????????
??????1?????????????
??????2??????????????????·????
??????3?????????????????????????????
??????????????????????У???????????????????????????????д??????????·??????????????????????????????????????????
????asi???????????cfnoteworking????????á?????????????block????????????????????
??????????????asi??????????????μ????????????
???????????????????????????????
?????????????
1 #import "YYViewController.h"
2 #import "ASIHTTPRequest.h"
3
4 @interface YYViewController ()<ASIProgressDelegate>
5 @property (weak?? nonatomic) IBOutlet UIProgressView *progress;
6 @end
7
8 @implementation YYViewController
9
10 - (void)viewDidLoad
11 {
12 [super viewDidLoad];
13 }
14
15 -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
16 {
17 //???????????????
18 [self download];
19 }
20
21 #pragma mark-???????
22 -(void)download
23 {
24 //1.???????????
25 NSURL *url=[NSURL URLWithString:@"http://127.0.0.1:8080/MJServer/resources/video.zip"];
26 ASIHTTPRequest *request=[ASIHTTPRequest requestWithURL:url];
27
28 //2.????????????????·??
29 NSString *cachepath=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory?? NSUserDomainMask?? YES)lastObject];
30 NSString *filename=[cachepath stringByAppendingPathComponent:@"video.zip"];
31 request.downloadDestinationPath=filename;
32 NSLog(@"%@"??filename);
33
34 //3.???????????????
35 request.downloadProgressDelegate=self.progress;
36
37 //4.????????????????
38 [request startAsynchronous];
39
40 //5.??????????
41 [request setCompletionBlock:^{
42 NSLog(@"?????????????");
43 }];
44 }
45
46 #pragma mark-??????????????????
????asi???????????????????????????????????????
????????????????????????£?
????request.allowResumeForFileDownloads=YES;
???????????????????????????????????30???????????У???????????????????????ε??????????????????????????????70?????????д??????С?
???????????????????????
????[request clearDelegatesAndCancel];
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???ios???????????????Щ????IOS???á?????豸?????TestAgent??????????????????MR????ν???IOS?豸???????????????????????MobileRunner iOS???????iOS???????iOS???????????? ???????????iOS??JSON?????????????iOS UnitTest?????????iOS?????????????6С???BugAppium iOS 10 ????????iOS???????iOS UI???????????iOS APP????????????????????????????????ν???iOS????????????????iOS?湫?????????????????????????????????????iOS???????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????