关于路径的使用,assi下载和


直接给一个路径下载图片,这函数直接使用assi

-(void)downloadWithURL:(NSString*)RequestUrl SavePath:(NSString*)savepath withQueue :(NSOperationQueue *)queue{

NSLog(@"downloadWithURL");

[selfindicatorAddInView];

//初始下载路径

NSURL *url = [NSURL URLWithString:RequestUrl];

//设置下载路径

if( myRequest != nil ){

[myRequestclearDelegatesAndCancel];

myRequest.delegate = nil;

myRequest = nil ;

}

myRequest = [[ASIHTTPRequestalloc] initWithURL:url];

//设置ASIHTTPRequest代理

myRequest.delegate = self;

//设置文件保存路径

[myRequestsetDownloadDestinationPath:savepath];

//获取旧类

//Class oldclass = object_getClass(obj);

//设置基本信息

//[request setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:obj, @"Object", /*oldclass, @"oldclass", */savepath, @"savePath", info, @"info", nil]];

//设置持续连接

myRequest.shouldAttemptPersistentConnection = YES;

//添加到ASINetworkQueue队列去下载

if( queue == nil ){

if(myQueue == nil){

myQueue = [[ASINetworkQueuealloc]init];

[myQueue go];

}

[myQueueaddOperation:myRequest];

return;

}

[queue addOperation:myRequest];

}

优质内容筛选与推荐>>
1、SAP 如何定义后台job
2、关于函数中内存操作
3、Git(三):Git 使用规范流程
4、Notepad 动画片,很强的
5、嵌入式中的上升沿与高电平触发的影响


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号