wordpress插件 网站跳转,中国五码一级做爰网站,godaddy wordpress迁移,网站开发程序流程图asi没法用了#xff0c;蛋疼了#xff0c;在af和mk之间纠结#xff0c;感觉af不适合我的口味#xff0c;解析和网络耦合相对似乎重了点 mk似乎默认的不支持下载的断点续传#xff0c;这里参考网上的代码处理了下#xff0c;0修改mk的库#xff0c;下面是实现的代码 //
/…asi没法用了蛋疼了在af和mk之间纠结感觉af不适合我的口味解析和网络耦合相对似乎重了点 mk似乎默认的不支持下载的断点续传这里参考网上的代码处理了下0修改mk的库下面是实现的代码 //
// RootViewController.m
// webTest
//
// Created by mmc on 13-11-24.
// Copyright (c) 2013年 mmc. All rights reserved.
//#import RootViewController.h
#import MKNetworkEngine.himplementation RootViewController- (IBAction) getTest:(id)sender
{MKNetworkEngine* engine [[MKNetworkEngine alloc] initWithHostName:192.168.1.105:8080];[engine useCache];NSMutableDictionary* params [NSMutableDictionary dictionaryWithCapacity:0];[params setObject:get数据1 forKey:arg1];[params setObject:get数据2 forKey:arg2];//最后的斜杠不能丢掉不然会出问题MKNetworkOperation *operation [engine operationWithPath:/yii/testApp/index.php?rhttpTest/getTest/params:paramshttpMethod:GET];[operation addCompletionHandler:^(MKNetworkOperation *completedOperation){NSString *responseString [completedOperation responseString];NSLog(%, responseString);if([completedOperation isCachedResponse]) {NSLog(Data from cache %, [completedOperation responseString]);}else {NSLog(Data from server %, [completedOperation responseString]);}}errorHandler:^(MKNetworkOperation *errorOp, NSError* error) {NSLog(%,error);}];[engine enqueueOperation:operation];}- (IBAction) postTest:(id)sender
{MKNetworkEngine* engine [[MKNetworkEngine alloc] initWithHostName:192.168.1.105:8080];[engine useCache];NSMutableDictionary* params [NSMutableDictionary dictionaryWithCapacity:0];[params setObject:post数据1 forKey:arg1];[params setObject:post数据2 forKey:arg2];MKNetworkOperation *operation [engine operationWithPath:/yii/testApp/index.php?rhttpTest/postTest/params:paramshttpMethod:POST];[operation addCompletionHandler:^(MKNetworkOperation *completedOperation){NSString *responseString [completedOperation responseString];NSLog(%, responseString);if([completedOperation isCachedResponse]) {NSLog(Data from cache %, [completedOperation responseString]);}else {NSLog(Data from server %, [completedOperation responseString]);}}errorHandler:^(MKNetworkOperation *errorOp, NSError* error) {NSLog(%,error);}];[engine enqueueOperation:operation];
}- (IBAction) downloadTest:(id)sender
{MKNetworkEngine* engine [[MKNetworkEngine alloc] initWithHostName:127.0.0.1];[engine useCache];NSArray *paths NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);NSString *cachesDirectory paths[0];NSString *downloadPath [cachesDirectory stringByAppendingPathComponent:x.iso];//判断之前是否下载过 如果有下载重新构造HeaderNSMutableDictionary *newHeadersDict [[NSMutableDictionary alloc] init];NSFileManager *fileManager [NSFileManager defaultManager];if ([fileManager fileExistsAtPath:downloadPath]){NSError *error nil;unsigned long long fileSize [[fileManager attributesOfItemAtPath:downloadPath error:error] fileSize];NSString *headerRange [NSString stringWithFormat:bytes%llu-, fileSize];[newHeadersDict setObject:headerRange forKey:Range];}MKNetworkOperation *operation [engine operationWithURLString:http://192.168.1.105:8080/2.iso];[operation addDownloadStream:[NSOutputStream outputStreamToFileAtPath:downloadPathappend:YES]];[operation addHeaders:newHeadersDict];[engine enqueueOperation:operation];//进度回调[operation onDownloadProgressChanged:^(double progress){NSLog(download %.2f, progress*100.0);}];//结束回调[operation addCompletionHandler:^(MKNetworkOperation* completedRequest){NSLog(download complete %, completedRequest);}errorHandler:^(MKNetworkOperation *errorOp, NSError* error){NSLog(%, error);}];
}end 下一步实现xxxBeginxxxEndxxxFail然后弄个delegates做响应链传递神奇的block实在受不了看起来真tmd不是一般的累啊重回接口回调- -