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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:23:16+00:00 2026-06-10T21:23:16+00:00

I have app in which if there is data in local data base then

  • 0

I have app in which if there is data in local data base then it will first upload it to server before starting the application i have written the upload code in app Deleage I want that while uploading is going on how to show activiy indicator with alert.
Normally it is easy to show to startAnimating and Stop, but how to do in this scenario?

   - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    


     [self copyDatabaseIfNeeded];


     NSMutableArray *tempArray = [[NSMutableArray alloc] init];
     self.coffeeArray = tempArray;
     [tempArray release];

     [Coffee checkData:[self getDBPath]];


  int mytestcount=rowCount;
        NSLog(@"My Test ROw Count IS %d",mytestcount);


    if (mytestcount=0) {


    NSLog("No Data To Upload");

    }


   else {


    [Coffee getInitialDataToDisplay:[self getDBPath]];

    [self uploadData];
   }


   [self.window addSubview:[navigationController view]];

       [self.window makeKeyAndVisible];

       return YES;
      }
  • 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-10T21:23:17+00:00Added an answer on June 10, 2026 at 9:23 pm

    Displaying UIActivityIndicator for this operation requires putting it in didFinishLaunchingWithOptions of appDelegate. Perform uploading in different thread so that indicator is displayed as long as operation is carried out. The change will be as follows :

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    
            [self copyDatabaseIfNeeded];
            NSMutableArray *tempArray = [[NSMutableArray alloc] init];
            self.coffeeArray = tempArray;
            [tempArray release];
            [Coffee checkData:[self getDBPath]];
            int mytestcount=rowCount;
            NSLog(@"My Test ROw Count IS %d",mytestcount);
            if (mytestcount=0) {
                NSLog("No Data To Upload");
            }
           else {
                [Coffee getInitialDataToDisplay:[self getDBPath]];
                //Set activity indicator here and perform uploading in different thread so that indicator is displayed as long as operation is carried out.  
    
               [self performSelector:@selector(uploadData) withObject:nil afterDelay:0];
           }
           [self.window addSubview:[navigationController view]];
           [self.window makeKeyAndVisible];
           return YES;
          }
    

    Creating a UIActivityIndicator in an alert is not difficult task. You can do it as follows :

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@" " message:@" " delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
    UIActivityIndicatorView *progress= [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 50, 30, 30)];
    progress.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
    [alert addSubview:progress];
    [progress startAnimating];   
    [alert show];  
    

    You can customize your alert as you like it to be.
    Hope this helps.

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

Sidebar

Related Questions

I have been designing my app to store local user data which is changed
I'm writing a windows phone app which stores data in a local database. There
I have an app which is based on a UINavigationController . There is a
I have a app which will download a file from web. The download action
I have an app which requires downloading image asynchronously in base64 encoded string(server is
I have an app which connects to xml generated by server. I would like
I have an App which receives a SQLite database to read some data and
I have a SQL Server that holds a lot of data. An application, running
I'm developing an app which will have a central database users can add entries
I have an app that loads several resources when it's first run, which are

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.