Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 23, 2010, 10:47 AM   #1
jjardim
macrumors newbie
 
Join Date: Mar 2008
UITableview Reload Data

-iPad Application-
I have a tableview with custom tableview cells with some dynamic data in it.

Example
Name
Tasks 1 of 4 complete

on the same screen I have a check box that completes the task. I am unable to get the tasks to change from 'Tasks 2 of 4 complete' unless I manually SCROLL the cell off the screen and then back on - I've tried [tableview reloadData] no luck. Is there a method to redraw the visible cells?

Thanks!
Jason Jardim
www.MacSpots.com
jjardim is offline   0 Reply With Quote
Old Sep 23, 2010, 11:55 AM   #2
Luke Redpath
macrumors 6502a
 
Join Date: Nov 2007
You can also use - (void)reloadRowsAtIndexPathsNSArray *)indexPaths withRowAnimationUITableViewRowAnimation)animation but if reloadData isn't working then I'm not sure that will either.

Is the cell that displays "x of y tasks complete" a custom subclass of UITableViewCell or are you using one of the built-in styles?
Luke Redpath is offline   0 Reply With Quote
Old Sep 23, 2010, 12:00 PM   #3
dejo
Demi-God (Moderator)
 
dejo's Avatar
 
Join Date: Sep 2004
Location: Colorado
reloadData should do the trick. In fact, it really only reloads visible cells. But perhaps some code, especially your tableView:cellForRowAtIndexPath:, would better help us diagnose.
__________________
dejo is online now   0 Reply With Quote
Old Sep 23, 2010, 12:21 PM   #4
PhoneyDeveloper
macrumors 68020
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
If you look at Apple's tableViewSuite sample code it does some things like this. One of the examples shows the time zones around the world and displays an icon that indicates whether it's day or night at each location and updates this dynamically as time changes.
PhoneyDeveloper is offline   0 Reply With Quote
Old Sep 23, 2010, 03:14 PM   #5
Sykte
macrumors regular
 
Join Date: Aug 2010
Quote:
Originally Posted by jjardim View Post
-iPad Application-
I have a tableview with custom tableview cells with some dynamic data in it.

Example
Name
Tasks 1 of 4 complete

on the same screen I have a check box that completes the task. I am unable to get the tasks to change from 'Tasks 2 of 4 complete' unless I manually SCROLL the cell off the screen and then back on - I've tried [tableview reloadData] no luck. Is there a method to redraw the visible cells?

Thanks!
Jason Jardim
www.MacSpots.com

Normally you want to use reloadRowsAtIndexPaths:withRowAnimation:. Tableview reloadData redraws all visible views which can be heavy. However if you are not getting the update with reloadData, reloadRowsAtIndexPaths will not help. How exactly are you updating your datasource.

umm just a shot in the dark but but are you doing [tableView reloadData] or [self.tableView reloadData].

Also make sure you're updating the dataSource before reloading the table.
Sykte is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
UIPickerView to reload data in UITableView CGagnon iPhone/iPad Programming 0 Aug 1, 2010 09:58 PM
HELP! Backgrounder Installation Stuck - Reloading Data!! firstjailbreak Jailbreaks and iOS Hacks 1 Jul 25, 2009 11:19 PM
Reload data of a table view from a child controller and another controlle dunadan iPhone/iPad Programming 2 Jun 1, 2009 09:54 AM
Trouble with UITableview and Data. Please help. Zac atack303 iPhone/iPad Programming 18 Apr 17, 2009 04:19 PM
TableView move and will be crash when reload data ? anim510 iPhone/iPad Programming 4 Nov 7, 2008 08:30 AM


All times are GMT -5. The time now is 03:57 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Privacy / DMCA contact / Affiliate and FTC Disclosure
Copyright 2002-2013, MacRumors.com, LLC