Re: UIActivityIndicatorView to send an action
Ah yes! I just used UITapGestureRecognizer and voila! It's working! Much cleaner this way. Thanks! -Carl > On Oct 14, 2022, at 1:45 PM, Richard Somers wrote: > > Why not use a gesture recognizer with the UIActivityIndicatorView to send an > action to a target object? > > Richard > > >> On Oct 14, 2022, at 1:37 PM, Carl Hoefs via Cocoa-dev >> wrote: >> >> The idea just occurred to me to place a clear UIButton atop the spinner and >> have that send the action. That will work but just seems kinda hacky... >> >>> On Oct 14, 2022, at 12:30 PM, Carl Hoefs via Cocoa-dev >>> wrote: >>> >>> Got an iPhone app enhancement request today to be able to tap the spinning >>> activity indicator (UIActivityIndicatorView) to pop up some info on the >>> status of the busy activity. >>> >>> UIActivityIndicatorView isn't like a UIButton which has sent actions, so is >>> there a way to do this? >>> >>> -Carl > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: UIActivityIndicatorView to send an action
The idea just occurred to me to place a clear UIButton atop the spinner and have that send the action. That will work but just seems kinda hacky... > On Oct 14, 2022, at 12:30 PM, Carl Hoefs via Cocoa-dev > wrote: > > Got an iPhone app enhancement request today to be able to tap the spinning > activity indicator (UIActivityIndicatorView) to pop up some info on the > status of the busy activity. > > UIActivityIndicatorView isn't like a UIButton which has sent actions, so is > there a way to do this? > > -Carl > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/newslists%40autonomy.caltech.edu > > This email sent to newsli...@autonomy.caltech.edu ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: UIActivityIndicatorView
Understood, thanks. Luca. On Jan 15, 2013, at 4:31 PM, Uli Kusterer wrote: > On Jan 15, 2013, at 3:18 PM, Luca Ciciriello > 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 (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: UIActivityIndicatorView
On Jan 15, 2013, at 3:18 PM, Luca Ciciriello 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 (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com