[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1166
  • Last Modified:

How to add the typical waiting icon to an iPhone application

Dear Expert:

I have an iPhone application which loads an image from an URL to an imageView control. I'm using this code:

NSURL * imageURL = [NSURL URLWithString:url];
NSData * imageData = [NSData dataWithContentsOfURL:imageURL];
i.image = [UIImage imageWithData:imageData];

Which code should I add in order to show the typical "waiting" icon (the typical animated icon which appears when you have to wait) while image is loading ?

I would like not to block user, I mean, I want to show this icon to let user know there is something in progress in this screen, but user should be able to interactuate with the view, for example going back to previous view by pressing a back button this view already has.

Thank you in advance.
0
gplana
Asked:
gplana
  • 3
  • 3
1 Solution
 
pgnatyukCommented:
Do you mean the network activity indicator?
I attached a code.
http://www.dizzey.com/development/ios/showing-network-activity-indicator-in-status-bar/
http://oleb.net/blog/2009/09/managing-the-network-activity-indicator/

You can add an activity indicator (spinner) in the interface builder to your view. Then, you may add an outlet and in your code call [myIndicator startAnimation]
http://iphonedevelopertips.com/user-interface/adding-an-activity-indicator-spinner-to-navigation-bar.html

UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = YES;

Open in new window

0
 
gplanaAuthor Commented:
Thank you for your answer, but in fact I'm referring to the typical waiting icon, not the network statusbar.

I mean like the hourglass in Windows, but in iPhone it's like the animated icon shown by a web-applicatio nusing slidebox, or like the animated icon that shows you should wait on Flash applications.
0
 
pgnatyukCommented:
Can you post a screenshot?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
gplanaAuthor Commented:
0
 
pgnatyukCommented:
Nice.
I do not have a code making this effect.
0
 
gplanaAuthor Commented:
It's not network indicator. After some investigation and some external help, it is activity indicator.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now