Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8199811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:14:51+00:00 2026-06-07T06:14:51+00:00

I am creating a network queue to send two requests.I have added these two

  • 0

I am creating a network queue to send two requests.I have added these two request in network queue.

-(void)viewDidLoad 
{
    [super viewDidLoad];
    ASINetworkQueue *networkQueue = [[ASINetworkQueue queue] retain];
    NSURL *url = [NSURL URLWithString:@"http://www.w3schools.com/xml/simple.xml"];
    NSURL *url1 = [NSURL URLWithString:@"http://search.twitter.com/search.json?q=mobtuts&rpp"];

    for(int i = 0; i<=1; i++)
    {
        if(i==0)
        {
            ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
            NSString *str =[NSString stringWithFormat: @"%d", i];
            request.userInfo = [NSDictionary dictionaryWithObject:str forKey:@"requestnum"];
            [request setDelegate:self];
            [networkQueue addOperation:request];
        }
        if(i==1)
        {
            ASIHTTPRequest *request1 = [ASIHTTPRequest requestWithURL:url1];
            NSString *str =[NSString stringWithFormat: @"%d", i];
            request1.userInfo = [NSDictionary dictionaryWithObject:str forKey:@"requestnum1"];
            [request1 setDelegate:self];
            [networkQueue addOperation:request1];   
        }
        [networkQueue go];
    }
}

For checking my responce i am getting the responce in
requestFinished:(ASIHTTPRequest *)request methode,
it always shows the first xml data as responce(NSLog(@”%@”,responseString);),
if i change my key from requestnum to requestnum1 i get the first xml data as responceString,why i am not able to access the second request’s responce.

-(void)requestFinished:(ASIHTTPRequest *)request
{
    NSString *str ;
    str= [request.userInfo objectForKey:@"requestnum1"];
    NSString *responseString = [request responseString];
    str = [request responseString];
    NSLog(@"%@",responseString);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:14:53+00:00Added an answer on June 7, 2026 at 6:14 am

    Its very simple to differentiate both request. Just assign tag to each request.

    for(int i = 0; i<=1; i++)
    {
        if(i==0)
        {
            ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
            NSString *str =[NSString stringWithFormat: @"%d", i];
            request.tag = 1; //<--Tag here
            request.userInfo = [NSDictionary dictionaryWithObject:str forKey:@"requestnum"];
            [request setDelegate:self];
            [networkQueue addOperation:request];
        }
        if(i==1)
        {
            ASIHTTPRequest *request1 = [ASIHTTPRequest requestWithURL:url1];
            NSString *str =[NSString stringWithFormat: @"%d", i];
            request1.tag = 2; //<--Tag here
            request1.userInfo = [NSDictionary dictionaryWithObject:str forKey:@"requestnum1"];
            [request1 setDelegate:self];
            [networkQueue addOperation:request1];   
        }
        [networkQueue go];
    }
    

    In request finish handle accordingly

    -(void)requestFinished:(ASIHTTPRequest *)request
    {
        NSLog(@"request tag-->%d",request.tag);
    
        NSString *str=nil;
        NSString *responseString = nil;
    
        switch (request.tag) 
        {
            case 1:
    
                str= [request.userInfo objectForKey:@"requestnum"];
                responseString = [request responseString];
                str = [request responseString];
                NSLog(@"Response reqeust 1 --->%@",responseString);
    
                break;
    
            case 2:
                str= [request.userInfo objectForKey:@"requestnum1"];
                responseString = [request responseString];
                NSLog(@"Response reqeust 2 --->%@",responseString);
    
                break;
            default:
                break;
        }
    }
    

    Enjoy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a simple WP7 app, to have all network settings in one place,
I'm creating a Facebook-like social-network website. For my wall, I have many different kind
I'm creating a network animator (similar to nam, if you have used it before).
I'm creating a social network in Rails. I have a User model and a
I'm creating a social network in Rails and I have a model like this:
I have a problem with Oracle Spatial Network package. I'm creating NODE, LINK and
I want to work on windows API. I have an interest in creating network
I am creating a social network and want to have a similar photo gallery
I'm creating a social network. I want to have a user be able to
I am creating a network chat client in C# as a side project. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.