Reload tableview iphone developer - iphone

I have a feed reader that read automatically the homepage of my website! But when I change the feed URL and reload data the cell isn't reloaaded! Infact I must scroll the cell view (infact with this action is called the didselectrowatindex method) to reload data in the cell with the new ones.
I tried [tableview reload]; without any results....
Is there a method to reload all content in the cell without scrolling it?
Thanks

Well, it should be [tableview reloadData]
If it's not working, then maybe you have a problem with your IBOutlet?

Related

updating tableViewCell with modifications done in another view

In my app am using tableview in which each cell am adding UIScrollView, in that scrollView again am adding UIView(this view is adding from another view class). When touch actions of view is performing but when i scroll the table all the modifications in view is reloading with what is there at the time of loading.
So how can we save the modifications of view which are done in another class in present tablecell.
in touchesEnded method am using
[music.createTableView beginUpdates];
[music.createTableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationNone];
[music.createTableView endUpdates];
Any help or suggestion.
Thanks in advance.
Suppose, you are using NSArray to show data in rows of tableview. Inside that, you will keep another NSArray to show array of UIViews inside a every row. If you use NSDictionary to store data of UIView, you can set a flag in that dictionary which will change according to user touch. Hope it will help you.

UITableCell turning blank after clicked

Im using a regular uitableview with regular uitablecells on it with some text and an image on them. When a cell is clicked I perform tableView: didSelectRowAtIndexPath:, in the end I call [tableView deselectRowAtIndexPath:indexPath animated:YES]; and everything works fine. But in the meantime before the next view loads its contents from the web, the clicked cell turns completely blank. Any clue on that?
If your problem is that you don’t want to show the touched UITableCellView as selected you can try cell.selectionStyle = UITableViewCellSelectionStyleNone;
Maybe if the problem is the load of the new UIView you can use NSThread and detach the process from the main thread.

iPhone - changing contents of a UITableViewCell inside a navigationController

I have a UITableView with some cells in it that have people's names. When the user clicks on a cell, the Navigation Controller pushes a new view onto the stack that shows detailed info for that person. When the user is done and clicks the button to return to the previous view, the tableview is again shown. The problem is that I want to edit the cell text (or just mark the cell in some way) to show that the user has clicked on that cell. In my cellForRowAtIndexPath: method I have set up code that should change the text of the cell after a user clicks on that cell. I set up break points and it IS entering cellForRowAtIndexPath: when the detail view is popped and the tableview is again shown. It's entering the segment of code in cellForRowAtIndexPath: that should change the text, but when it comes up on screen, the text has not been changed. Does anyone have any ideas as to what is going on? Thanks.
EDIT: I figured it out. I just needed to call [tableView reloadData]; instead of calling the cellForRowAtIndexPath method. Not sure why that works differently, but it fixed it.
I guess I'll help you out. You don't need to credit me with the answer though.
cellForRowAtIndexPath:
that method is called within the framework when a cell is being refreshed from the queue or when it needs to be created. You should not call this method.
[tableView reloadData];
that method is basically a refresh on all of the visible cells show in the UITableView. This is the method you should call if you change information in your data source or you need to (force) update the appearance of your cells.
It's Good You Have Reload Table And Changed The Text But If YouJustIndicate NAd Don't Want To Change The Text The nYou Can Use elow Given Text ....
[cell setAccessoryType:UITableViewCellAccessoryCheckmark];
It Will Check Mark Particuler Cell Which You Click/Visited......
Hope You Like This Solution.....

Update UITableViewCell without reload

So here's my situation:
I have a UITableView where each cell has some buttons.
In the cellForRowAtIndexPath I set the indexpath of the row so when the a button is clicked I know what row was clicked.
One of the buttons is a delete button and when pressed I remove the backing data and delete the row from the table.
The problem I'm having is that after I delete a row the indexPath's of the other rows are incorrect as the other rows have not been redrawn. The only way I can find to redraw the table is to call reload but this messes up the animation.
I figure this kind of problem must have been addressed before. Does anyone have any suggestions on how to get around this? I'm ok with changing the way I've designed my buttons to work if there is a better way.
Think you need to use this...
- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
Apple reference!
You should be able to redraw the tableview without a full reload by starting and ending an update like this:
[tableView beginUpdates];
[tableView endUpdates];
call the method:
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
It is better not to store the indexPath with the buttons. In the button action handler (which is either a method in your cell subclass or in your viewController) you could identify the cell, and subsequently determine the indexPath using -indexPathForCell:.

Why my tableView doesn't update without scrolling it down?

I am making an nav based app. in my table view i am parsing a xml and showing its data. when i enter new feed item in my xml and click refresh button, my data updates but it didn't appear in tableView untill i scroll it down. When i scroll it down it appears. Can anybody tell me why its happening like that? I want new data appear when i enter the feed item without scrolling my tableView down. Thanx for help
you need to call [self.tableView reloadData] to update the tableView with new contents
Did you call [tableView reloadData] when the data has been refreshed?
You need to reload the cells (or the entire table) for the new data to appear.
Depending on if you return parsed results right away or all results after the entire xml-file has been parsed.
The code to update the table is:
[myTableView reloadData];
You have to call [tableView reloadData] to refresh the data from the UITableView.
Call [tableView reloadData] when the parsing is completed
I'm not exactly sure what you mean. A simple reload is:
[myTableView reloadData]
in the UITableViwController
[self.tableView reloadData]
If you scroll down, new cells that are rendered will use the new data. but cells that are on display have to be told to update immediatly.
Not just -reloadData, you can use any of these:
reloadData
reloadRowsAtIndexPaths:withRowAnimation:
reloadSections:withRowAnimation:
reloadSectionIndexTitles
Basically, you'll need to tell your tableview that your data has changed so it knows to change that. You can do it with fancy animations and whatnot so that the user isn't confused when what's displayed on screen suddenly changes.