Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-19-2008, 04:34 PM   #1 (permalink)
New Member
 
Join Date: Jul 2008
Posts: 75
Default Webservice load wait

I am creating an app to tie into a web service. Now I want to show a loading indicator since it can take a few sections for the data to come back.

My app is all based on a tableview so everything is like the drilldown example. I'd like to use a modal but from reading Apple frowns on using them.

So anyone have any ideas on what options I can do?

thanks
hijinks is offline   Reply With Quote
Old 08-19-2008, 04:55 PM   #2 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 189
Default

Maybe draw a progress bar on the screen but not on a modal and just fade out the table view till its fully loaded. All can be done with core animation and core graphics. Don't let what apple frowns upon affect you too much. If a modal is the most user friendly way you can think of then you may be an exception. Apple just frowns upon over using them for causes that can be handled in some other more organized way.

Quote:
Originally Posted by hijinks View Post
I am creating an app to tie into a web service. Now I want to show a loading indicator since it can take a few sections for the data to come back.

My app is all based on a tableview so everything is like the drilldown example. I'd like to use a modal but from reading Apple frowns on using them.

So anyone have any ideas on what options I can do?

thanks

Last edited by Abel; 08-19-2008 at 04:58 PM.
Abel is offline   Reply With Quote
Old 08-19-2008, 05:30 PM   #3 (permalink)
Registered Member
 
Jume's Avatar
 
Join Date: Jul 2008
Location: Slovenia, EU
Posts: 264
Send a message via Skype™ to Jume
Default

I'm doing it in this way using UINavigationController and view controllers. This is the structure I have

Code:
UINavigationController
|
|--UIViewController //root view controller
    |
    |--UIView // showing activity indicator
    |--UITableView // showing table
So here how I code this

1) I'm loading and displaying UINavigationController with a root view controller
2) Asking a web service for data and loading UIView with activity indicator as a root view controller's view
3) Once the data from web service is ready I animate the opacity of the root controller's view to 0.0 and then I'm replacing it with the UITableView ...

I think apple does something similar in App Store and iTunes apps.
Jume is offline   Reply With Quote
Old 08-19-2008, 05:35 PM   #4 (permalink)
Registered Member
 
Join Date: Jul 2008
Posts: 189
Default

Very similar to what I suggested, seems like the most efficient and prettiest way to do it. Just do something playing with the opacity and displaying the indicator.

What I would do is have the indicator be the main focus by lowering the table views opacity then animating it back into full opacity when the indicator is done.

Quote:
Originally Posted by Jume View Post
I'm doing it in this way using UINavigationController and view controllers. This is the structure I have

Code:
UINavigationController
|
|--UIViewController //root view controller
    |
    |--UIView // showing activity indicator
    |--UITableView // showing table
So here how I code this

1) I'm loading and displaying UINavigationController with a root view controller
2) Asking a web service for data and loading UIView with activity indicator as a root view controller's view
3) Once the data from web service is ready I animate the opacity of the root controller's view to 0.0 and then I'm replacing it with the UITableView ...

I think apple does something similar in App Store and iTunes apps.
Abel is offline   Reply With Quote
Old 01-29-2009, 12:53 PM   #5 (permalink)
Registered Member
 
Join Date: Jan 2009
Location: Madrid (Spain)
Posts: 57
Default

Im recently new..., I want to do the same but i dont know how to implementat it, have someone any exmample of this? to make the opacity of the root controller view and to replace with the uitableview. Thanks
estupefactika is offline   Reply With Quote
Old 01-29-2009, 03:05 PM   #6 (permalink)
Lost in a sea of code
 
BostonMerlin's Avatar
 
Join Date: Apr 2008
Location: Boston
Posts: 399
Default

on my webservice call i first load the table view, then before the webservice call add a view on top of my tableview shown below.. a timer checks a background thread for the webservice call to complete.. once complete i remove the overlay view with animations.. looks great.

Code:
	//SETS UP FADED OVERLAY FOR WHEN USER HITS SYNC BUTTON
	fadeView = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,373) ];
	fadeView.backgroundColor = [UIColor blackColor];
	[fadeView setAlpha:0.0];
	fadeView.tag = 1;

        //STARTS THE SYNC METHOD
	[self.view addSubview:fadeView];
	[fadeView setAlpha:0.0];	
	[UIView beginAnimations:@"fadeOutSync" context:NULL];
	[UIView setAnimationWillStartSelector:@selector (syncFadeViewDidStart1:context:) ];
	[UIView setAnimationDidStopSelector:@selector (syncFadeViewDidEnd1:finished:context:) ];
	[UIView setAnimationDelegate:self];
	[UIView setAnimationDuration:1.5];
	[fadeView setAlpha:0.7];
	[UIView commitAnimations];

        //ENDS THE SYNC METHOD
	[UIView beginAnimations:@"fadeInSync" context:NULL];
	[UIView setAnimationWillStartSelector:@selector (syncFadeViewDidStart2:context:) ];
	[UIView setAnimationDidStopSelector:@selector (syncFadeViewDidEnd2:finished:context:) ];
	[UIView setAnimationDelegate:self];
	[UIView setAnimationDuration:1.5];
	[fadeView setAlpha:0.0];
	[UIView commitAnimations];
__________________
----------------------------------------------------------------------
I love being a dad, flying airplanes and writing code.
----------------------------------------------------------------------
Follow me on Twitter: @BostonMerlin
Feed your brain on Twitter: @iPhoneDev101
----------------------------------------------------------------------
iPhone Apps:
BostonMerlin is offline   Reply With Quote
Old 01-29-2009, 06:30 PM   #7 (permalink)
New Member
 
Join Date: Jan 2009
Location: Zurich, Switzerland
Posts: 3
Default

i'm displaying a full screen loading-view (.80 alpha, black, with activity indicator and label) sitting in the main xib and initially had a problem with the view not showing up while waiting for the data to be returned in a synchronous url connection. the connection blocked the ui rendering so the view just quickly appeared after all data was received and disappeared a few milliseconds later.

after many, many tries i've put the url request code into a thread which solved the issue.

just in case someone is having the same issue, can't guarantee that this is the nices way to solve this, though
__________________
ShowMe - Images instead of translation
TravelHelp - Find out more about where you are
uly81 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 418
10 members and 408 guests
AppleSteve, chiataytuday, DaveDee, Domele, HowEver, ilmman, Jameswhitfield, johnRambo, LEARN2MAKE, shiv@globussoft.com
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 157,854
Threads: 88,915
Posts: 379,298
Top Poster: BrianSlick (7,072)
Welcome to our newest member, Jameswhitfield
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:43 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0