• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UIActivityIndicatorView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UIActivityIndicatorView


  • Subject: Re: UIActivityIndicatorView
  • From: Luca Ciciriello <email@hidden>
  • Date: Tue, 15 Jan 2013 16:38:42 +0100

Understood, thanks.

Luca.

On Jan 15, 2013, at 4:31 PM, Uli Kusterer <email@hidden> wrote:

> On Jan 15, 2013, at 3:18 PM, Luca Ciciriello <email@hidden> wrote:
>> I use an activity indicator in order to show, in my UIViewController, a "work in progress" activity.
>>
>> here my code
>>
>> - (void)myMethod
>> {
>> 	[[self activityElab] setHidden:NO];
>> 	[[self activityElab] startAnimating];
>>
>> 	// here I call a very CPU-intensive method.
>>
>> 	[[self activityElab] setHidden:YES];
>> 	[[self activityElab] stopAnimating];
>> }
>>
>> My problem is that nothing appear (activity indicator) when myMethod is called. Now if I remove (comment) the call to my "intensive activity" method all is working fine.
>>
>> Any idea? I've tested this code both on the simulator and on a device (iPad) with  iOS 5.0 and iOS 6.0
>> My environment is Xcode 4.5.2 on OS X 10.8.2.
>
>
> That won't work. Views are only redrawn once your method returns. So while your activity indicator is shown and hidden, nobody will ever see it. If you do activities that take a long time, you'd better split them up into smaller NSOperations which let the main thread redraw the UI in between each operation. Or if you have to, use a separate thread, but that's hard to get right, and easy to get wrong in a way that causes random hard-to-find crashes.
>
> Cheers,
> -- Uli Kusterer
> "The Witnesses of TeachText are everywhere..."
> http://www.zathras.de
>
>


_______________________________________________

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

References: 
 >UIActivityIndicatorView (From: Luca Ciciriello <email@hidden>)
 >Re: UIActivityIndicatorView (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: UIActivityIndicatorView
  • Next by Date: Re: Resizing UIView: Content CALayer doesn't resize
  • Previous by thread: Re: UIActivityIndicatorView
  • Next by thread: NSRuleEditor help?
  • Index(es):
    • Date
    • Thread