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 11-25-2009, 03:06 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Montreal, QC
Posts: 16
Unhappy UIActivityIndicatorView only showing up after page is loaded

Howdy...

I'm trying to get a UIActivityIndicatorView to appear while a new view is being loaded.

The 2nd view i am trying to load is sourcing the information from the internet and sometimes takes a few minutes to load. So far, i can see my activityInicator once the page is about to be loaded


I start the animation off of a button that is loading the view.

Code:
-(IBAction)viewBlog{
	[self.activityIndicator startAnimating];
	
	BlogViewController *blogView = [[BlogViewController alloc] initWithNibName:@"BlogViewController" bundle:nil];
		
	[self.navigationController pushViewController:blogView animated:YES];
	
	[blogView release];
}
But it only seems to load once my blogView has been loaded..

Can anyone help me figure out how to get the activityIndicator to show up as soon as i press my button!!!

Thanks for any and all the help
simply07 is offline   Reply With Quote
Old 11-25-2009, 03:29 PM   #2 (permalink)
Registered Member
 
Join Date: Nov 2009
Location: London
Posts: 226
Default

You need to return control to UIKit -- by returning from your method -- to let it update the activity indicator. Try splitting you method like this:

Code:
-(IBAction)viewBlog{
	[self.activityIndicator startAnimating];
	
    [self performSelector: @selector(_viewBlog) withObject: nil afterDelay: 0.0];
}

-(void)_viewBlog {
	BlogViewController *blogView = [[BlogViewController alloc] initWithNibName:@"BlogViewController" bundle:nil];
		
	[self.navigationController pushViewController:blogView animated:YES];
	
	[blogView release];
}
__________________
SimCap - Simple iPhone and iPad Simulator screen capture
_sjc_ is offline   Reply With Quote
Old 11-25-2009, 03:42 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Montreal, QC
Posts: 16
Talking wow... thank you so much

Thank you so much...

I understand what you mean, but i'm gonna look into the bit of code you send because perfromSelector is new to me!!!

I really appreciate the quick responce, thanks again
simply07 is offline   Reply With Quote
Reply

Bookmarks

Tags
ibaction, startanimating, uiactivityindicatorview

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: 280
20 members and 260 guests
ADY, Bertrand21, Dani77, HemiMG, iDifferent, IphoneSdk, jakerocheleau, JasonR, jimbo, macquitzon216, MACralik, mer10, NSeven, prchn4christ, Rudy, silverwiz, spiderguy84, Sunny46
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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