• 关于路径的使用,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];

    }

  • 相关阅读:
    PHP 指定的 CGI 应用程序由于未返回完整的一组 HTTP 头而产生错误行为。
    BPM触发事件
    封装继承多态到底讲的是什么
    .Net 为什么叫.Net 转载自 jerrylsxu 的博客
    C# 琐碎记忆 Message
    SQL Case
    C# 命名规范(部分)
    C# 反射
    C# 日志 log 配置文件
    C# 琐碎记忆 三元表达式
  • 原文地址:https://www.cnblogs.com/alihaiseyao/p/3544747.html
Copyright © 2020-2023  润新知