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 01-05-2009, 08:18 AM   #1 (permalink)
New Member
 
Join Date: Dec 2008
Location: Islamabad, Pakistan
Posts: 42
Default iPhone Development - Setting scroll position in UITableView

I have an application that works some what similar to how iPhone's Contact application works. When we add a new Contact user is directed to a view only screen with Contact information. If we select "All Contacts" from the navigation bar, user is navigated to list of all contacts where the recently added contact is in view.

We can move the view to a particular row using:

Code:
[itemsTableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionBottom];
... but it's not working. I'm calling this right after calling:

Code:
[tableView reloadData];
I think i'm not suppose to call selectRowAtIndexPath:animated:scrollPosition method here. But if not here, then where?

Is there any delegate method that gets called after the following method:

Code:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
Thanks,
Mustafa
ghulam.mustafa is offline   Reply With Quote
Old 01-18-2009, 11:40 PM   #2 (permalink)
New Member
 
Join Date: Dec 2008
Location: Islamabad, Pakistan
Posts: 42
Default

Anyone? Any ideas?
__________________
Mustafa
ghulam.mustafa is offline   Reply With Quote
Old 01-19-2009, 10:38 AM   #3 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 91
Default

I am trying to do this also... here is some code that I believe works...

Code:
[rootViewController.mainViewController.myTableView scrollToRowAtIndexPath:[NSIndexPath indexPathWithIndexes: ints length:2] atScrollPosition:UITableViewScrollPositionTop animated:YES];
pcmofo is offline   Reply With Quote
Old 01-19-2009, 11:27 AM   #4 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 91
Default

[myTable scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];

This code works for me....
pcmofo is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone development, reload data, uitableview, uitableviewscrollposition

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: 265
20 members and 245 guests
14DEV, @sandris, ADY, ArtieFufkin10, ckgni, Dani77, HemiMG, IphoneSdk, jakerocheleau, JasonR, jimbo, MACralik, NSeven, prchn4christ, Rudy, silverwiz, spiderguy84
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 02:55 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0