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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:49:13+00:00 2026-05-12T06:49:13+00:00

I am having a bit of a problem here, I am let the user

  • 0

I am having a bit of a problem here, I am let the user upload some video to the server however I am having some difficulties managing a view that I am using to illustrate its progress, I know why the problem is happening and i found a way around it (sort of) here my problem

So if one tries to make some code that looks something like this (in a UIViewController

-(void)uploadMovie
{
   UIActivityView indicator=new...
  [self.view addSubview:indicator]
   [uploader UploadMyMovie:data]

 }

This code wont work, the uploader will lock the controller and will not allow time for the indicator to come on screen in time, i found waiting for a few seconds before calling the uploader works but i took another approach.

The approach was to start a new thread for the uploader and have a protocol in which the uploader object informs the UIViewController (or some delegate) when it starts uploading, its progress, and when it finishes uploading. Something like

     -(void)uploadMovie
    {
       UIActivityView indicator=new...
      [self.view addSubview:indicator]
       NSThread *thread=...
       [thread start]
     }

the delegate methods look something like this

    #pragma mark UploadProgressDelegate

-(void)didStartUploading
{

    progressLabel= [[UILabel alloc] initWithFrame:CGRectMake(93, 240, 116, 32)];
    ind= [[UIActivityIndicatorView alloc]   initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    ind.center=self.view.center;
    [progressLabel setTextColor:[UIColor blackColor]];
    [progressLabel setText:@"TEST"];
    [self.view addSubview:progressLabel];
    [self.view addSubview:ind];
    [ind startAnimating];
    [self.view bringSubviewToFront:progressLabel];
    [ind setHidesWhenStopped:TRUE]; 
    [self.view setUserInteractionEnabled:FALSE];
}
-(void)progressUpdate:(NSString*)progress
{
     [progressLabel setText:progress];
}
-(void)didEndUploading;
{
    [progressLabel removeFromSuperview];
    [ind stopAnimating];
    [ind removeFromSuperview];
    [progressLabel release];
    [ind release];
    [self.view setUserInteractionEnabled:TRUE];
}

This works great and the indicator shows and everything, then i decided to let the user see the progress by adding a UILabel (reflected in the code above), howeverr for this the solution does not work, the label does not display and ofcourse no updates…

I was wondering if anyone has encounter this situation and has come up with a solution for it? or if you can possibly see from the code above why the label isnt showing…

Thanks

  • 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-05-12T06:49:13+00:00Added an answer on May 12, 2026 at 6:49 am

    UIKit is not thread-safe. If you’re updating a UI element, you need to sync back into the main thread or all bets are off.

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

Sidebar

Related Questions

I'm having a bit of a problem here. We have 2 urls let me
I'm having a little bit of trouble understanding what the problem is here. I
I'm having bit complicated object model that forms a triangle. There is User entity
I'm having a bit of a problem with NSDateFormatter failing on one user's device
I'm having a bit of a problem here. What I want to do is
I am having a bit of a problem here with this statement below using
I'm having a bit of a problem with a very weird side effect that's
Having a bit of CSS problem here. First off, my HTML code: <p> <span
I am having a bit of a problem here. I have two int values,
Ok, so I'm having a bit of a problem here. I need to be

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.