Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicator not dismissing #8

Open
keithlee opened this issue Dec 8, 2016 · 6 comments
Open

Indicator not dismissing #8

keithlee opened this issue Dec 8, 2016 · 6 comments

Comments

@keithlee
Copy link

keithlee commented Dec 8, 2016

Issue happens when:

  1. Load a viewcontroller, query something in the background (e.g. Parse query.findObjectsInBackground)
  2. In query.findObjectsInBackground callback (dismiss Progress)
  3. Indicator still there

Note: Only occurs on first time FTIndicator is loaded. Hacked around issue by callign showprogress and then dismissprogress in AppDelegate before any views can be loaded

Happens when loading a new view controller. I believe the indicator hasn't had time to load before calling my dismiss, which causes the issue. Showing and dismissing progress occurs on main thread

@liufengting
Copy link
Owner

liufengting commented Dec 8, 2016

I think maybe when query done callback, you should call dispatch_get_main_queue().

@keithlee
Copy link
Author

keithlee commented Dec 8, 2016

I tried that, still didn't work. Confirmed that showing/dismissing is on main queue. Its something about the initial initialization of the FTIndicator thats having issues

@liufengting
Copy link
Owner

liufengting commented Dec 8, 2016

I tried the following methods, works fine. Just upload some code, try run the demo and click the + button on the up-left. Maybe let me see some of your code to help me understand more about this issue. Thanks.

  • (void)viewDidLoad {
    [super viewDidLoad];

    [FTProgressIndicator showProgressWithmessage:@"Something is happening..."];

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

      for (NSInteger i = 0; i < 1000; i++) {
          NSLog(@"print out %ld",i);
      }
      
      sleep(3);
      
      dispatch_async(dispatch_get_main_queue(), ^{
          [FTProgressIndicator dismiss];
      });
    

    });

}

@keithlee
Copy link
Author

keithlee commented Dec 8, 2016 via email

@liufengting
Copy link
Owner

liufengting commented Dec 8, 2016

Make sure it is dispatch_async. other than that, I can't find any other way to solves this for now.

@keithlee
Copy link
Author

keithlee commented Dec 8, 2016 via email

liufengting added a commit that referenced this issue Sep 7, 2017
fix progressView can not didmiss bug,fix issuce #8
liufengting added a commit that referenced this issue Sep 8, 2017
liufengting added a commit that referenced this issue Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants