Re: Best practice with NSProgressIndicator
Re: Best practice with NSProgressIndicator
- Subject: Re: Best practice with NSProgressIndicator
- From: Alex Zavatone <email@hidden>
- Date: Fri, 28 Jul 2017 14:59:57 -0700
Use MBProgressHUD. It has much better options for deterministic and
indeterminate progress indicators.
I have been using it since 2011 or 2012.
There are several factors that many people are unaware of in that if the
operation completes in under .75 seconds, you do not want to display the
progress indicator, but if it takes longer, you must show it for a minimum
period of time of 1.25 seconds.
If you do not do this, it will flash on the screen for a short time and look
odd to the user.
Sent from my iPhone
> On Jul 28, 2017, at 8:57 AM, Mark Allan <email@hidden> wrote:
>
> Hi all,
>
> I'm wondering if anyone has any thoughts about or links to best practices
> when using determinate NSProgressIndicators.
>
> I have an app with a helper tool that performs some lengthy process in a loop
> and reports progress to the user. It works out how many iterations of the
> loop will be needed, sets the progressbar.maxValue, and then increments the
> progress bar's value on each iteration.
>
> The consumes a large amount of CPU time just for updating the progress bar,
> so I'd like to cut down how often I update it.
>
> Setting the max value to 100 and only updating 100 times (i.e. as a
> percentage) seems too infrequent because the loop can iterate more than a
> million times.
>
> I'm debating doing it with an NSTimer firing every second, but wondered if
> anyone had any other suggestions?
>
> What are people's thoughts?
>
> I've tried searching online and the only problems/solutions I can see are all
> related to people's progress bars not updating properly because they're
> blocking the main thread etc. I can't see anything related to best practice.
>
> Many thanks
> Mark
>
> PS. It could be that this is a case of premature optimisation...but I don't
> think so!
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden