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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 10-13-2009, 02:46 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 23
xnapp is on a distinguished road
Default Choppy Scrolling

Hi,

I'm using the footer view of a UITableView to house 2 buttons. However, the scrolling up and done seems to be rather choppy. The code I'm using at the moment is:

Code:
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
	if(footerView == nil) {
		footerView = [[UIView alloc] init];
	}
	if(section == 4) {
		UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
		[button setFrame:CGRectMake(10, 5, 115, 40)];
		[button setTitle:@"Where am I?" forState:UIControlStateNormal];
		[button setBackgroundColor: [UIColor clearColor]];
		[button addTarget:self action:@selector(showInMapApp:) forControlEvents:UIControlEventTouchUpInside];
		/*UIButton *makeContact = [UIButton buttonWithType:UIButtonTypeRoundedRect];
		[makeContact setFrame:CGRectMake(135, 5, 150, 40)];
		[makeContact setTitle:@"Create new contact" forState:UIControlStateNormal];
		[makeContact setBackgroundColor: [UIColor clearColor]];
		[makeContact addTarget:self action:@selector(createNewContact:) forControlEvents:UIControlEventTouchUpInside];*/
		[footerView addSubview:button];
		//[footerView addSubview:makeContact];
		return footerView;
		[footerView release];
	} else
		return nil;
	[footerView release];
}
I'd appreciate any help into why it's so choppy in the scrolling
xnapp is offline   Reply With Quote
Old 10-13-2009, 02:49 PM   #2 (permalink)
jsd
at this moment
 
Join Date: Mar 2009
Location: San Francisco, CA
Posts: 900
jsd is on a distinguished road
Default

You're creating and adding a new button every time the table scrolls even a little bit. Create the view once (try doing it in IB! it's fast and easy) then just return it out of your function.
jsd is offline   Reply With Quote
Old 10-13-2009, 02:59 PM   #3 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 23
xnapp is on a distinguished road
Default

I'd prefer to do it in XCode. Is there no way to only make it run once without using interface builder.
xnapp is offline   Reply With Quote
Old 10-13-2009, 03:23 PM   #4 (permalink)
jsd
at this moment
 
Join Date: Mar 2009
Location: San Francisco, CA
Posts: 900
jsd is on a distinguished road
Default

Quote:
Originally Posted by xnapp View Post
I'd prefer to do it in XCode. Is there no way to only make it run once without using interface builder.
You can absolutely just run it once. Create the view when you create the class, keep it in a class property and return it when called.

However, read this when you get a chance
iPhone Development: Don't Fear the Interface Builder
jsd is offline   Reply With Quote
Reply

Bookmarks

Tags
choppy, footer, lag, table, view

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: 335
9 members and 326 guests
givensur, glenn_sayers, guusleijsten, ipodphone, mediaspree, mtl_tech_guy, Punkjumper, whitey99, yys
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,114
Posts: 402,883
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

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