1

我有一个应用程序,我想在其中发出几个异步请求,然后在收到响应后刷新视图或类似的东西。如何确定响应与特定请求相关联?由于这是异步的,我不想维护 URL 的属性,因为会发出多个请求。

    [HttpRequestManager makeASynchronousRequest:url withTarget:self withSelector:@selector(receivedImageData:)];

    - (void) receivedImageData:(NSMutableData *) data
    {
        if (data) {
            UIImage *image = [[[UIImage alloc] initWithData:data] autorelease];

            NSString *path = [self savePngImage:image withLocalURL:**URL should be the one I created earlier**];
            if (path) {
                [self.delegate receivedImage:image];
            }
            else
           {
           }
        }
    }

我可以在@selector(receivedImageData:) 中传递 URL 吗?

4

0 回答 0