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 9214743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:02:23+00:00 2026-06-18T02:02:23+00:00

I am uploading data to server i want that when i click upload button

  • 0

I am uploading data to server i want that when i click upload button then activity indicator should start and stop after the data is uploaded.

This is how i am uploading data but activity indicator not working.

       -(IBAction)startSyncButtonAction{

        [self startActivity];   
    CereniaAppDelegate *appDelegate = (CereniaAppDelegate *)[[UIApplication sharedApplication] delegate];


   for (int i=0; i<[appDelegate.coffeeArray count]; i++) {

   Coffee *coffeeObj = [appDelegate.coffeeArray objectAtIndex:i];


    int mycount=[appDelegate.coffeeArray count];
    NSLog(@"My Array count is %d",mycount);


    NSString*device_Id=coffeeObj.device_Id;
    NSString*R1=coffeeObj.R1;
    NSString*R2=coffeeObj.R2;
    NSString*R3=coffeeObj.R3;
    NSString*R4=coffeeObj.R4;
    NSString*R5=coffeeObj.R5;
    NSString*R6=coffeeObj.R6;
    NSString*R7=coffeeObj.R7;
    NSString*R8=coffeeObj.R8;
        NSString*R9=coffeeObj.R9;
    NSString*R10=coffeeObj.R10;
    NSString*R11=coffeeObj.R11;
    NSString*R12=coffeeObj.R12;
    NSString*R13=coffeeObj.R13;
    NSString*R14=coffeeObj.R14;     

        NSString*update_date_time=coffeeObj.update_date_time;

         NSString*teritory1=coffeeObj.teritory;

         int mycount1=[appDelegate.coffeeArray count];

         NSLog(@"My Array After delete is %d",mycount1);
            NSLog(@"device_Id%@",device_Id);
    NSLog(@"R1%@",R1);
    NSLog(@"R2%@",R2);
    NSLog(@"R3%@",R3);
    NSLog(@"R4%@",R4);
    NSLog(@"R4%@",R5);
    NSLog(@"R4%@",R6);
    NSLog(@"R4%@",R7);
    NSLog(@"R4%@",R8);
    NSLog(@"R4%@",R9);
    NSLog(@"R4%@",R10);
    NSLog(@"R4%@",R11);
    NSLog(@"R4%@",R12);
    NSLog(@"R4%@",R13);
    NSLog(@"R4%@",R14);

     NSLog(@"update_date_time%@",update_date_time);

    NSString *post =[[NSString alloc] initWithFormat:@"device_Id=%@&R1=%@&R2=%@&R3=%@&R4=%@&R5=%@&R6=%@&R7=%@&R8=%@&R9=%@&R10=%@&R11=%@&R12=%@&R13=%@&R14=%@&update_date_time=%@&teritory1=%@",device_Id,R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,R11,R12,R13,R14,update_date_time,teritory1];



      NSLog(post);
      NSURL *url=[NSURL URLWithString:@"http://celeritas-solutions.com/pah_brd_v1/pfizersurvey/SyncSurveySTD.php"];
    NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
    NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init] ;
    [request setURL:url];
    [request setHTTPMethod:@"POST"];
    [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
    [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
    [request setHTTPBody:postData];
    NSError *error;
    NSURLResponse *response;
    NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
    NSString *data=[[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding];
    NSLog(@"%@",data);

       }


        for (int i=0; i<[appDelegate.coffeeArray count]; i++) {

    Coffee *coffeeObj = [appDelegate.coffeeArray objectAtIndex:i];


     [appDelegate removeCoffee:coffeeObj];

    }

    }

     -(void)startActivity:(id)sender
  {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

    activityImageView.hidden=NO;
    activityView.hidden=NO;

    [activityView startAnimating];

     [pool release];
    }
  • 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-18T02:02:24+00:00Added an answer on June 18, 2026 at 2:02 am

    Try below code but I am giving example you should modify it & use according to your need:

     alert= [[UIAlertView alloc] initWithTitle:@"Loading\nPlease Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil];
                    [alert show];
    
                    UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    
                    indicator.center = CGPointMake(150, 100);
                    [indicator startAnimating];
                    [alert addSubview:indicator];
    

    Use this line to dismiss indicator:

    [alert dismissWithClickedButtonIndex:0 animated:YES];
    

    Try. Best of luck.

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

Sidebar

Related Questions

I'm trying to make a script that automatically starts uploading after the data has
I am getting a problem when I am uploading the data to server. Actually
Im currently uploading data to MS SQL server via SQLBulkCopy and Transactions. I would
I am looking for best practice for uploading excel data in Sql server 2000
I was uploading the data to App Engine (not dev server) through loader class
I want to send image data from android client to the server. But there
I want to upload a plist file to my server from my iphone app.
Say I want to have a server that can accept 2GB file over network,
Can anyone give me some idea about uploading data from excel to access database
I’ve been trying to follow some examples for uploading data to a website. I

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.