Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iPhoneSpain

macrumors newbie
Original poster
Sep 27, 2009
28
0
Hello,

I want to show a loading message while I am retrieving some data from the Internet. I am using the code from:

http://cocoawithlove.com/2009/04/showing-message-over-iphone-keyboard.html

The code I use is very simple:
Code:
LoadingView *loadingView = [LoadingView loadingViewInView:[self.view.window.subviews objectAtIndex:0]];
	
//Retrieve data
	
[loadingView performSelector:@selector(removeView) afterDelay:5];
The problem is that the loading image only shows up when the retrieve data method has finished and that´s not what I am looking for. I want the loading window to stay until retrieve data method has finished.

Do i have to call retrieve data in a thread (performSelectorInBackground)???

This must be very easy but I am a bit newbie sorry :S

Thanks in advance
 
You would typically load data from the internet using NSURLConnection's asynchronous methods. You don't need to use a background thread if you do that. You also might be able to avoid the progress indicator, depending on your app's UI design.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.