iOS 7 UITableView reload not showing any cells - iphone

The table view shows properly at the start, but when I do a reload due to someone typing text in a searchbox, the table does not show the cells. This worked perfectly in iOS 7
This is what I see, everything is called correctly, cellForRowAtIndexPath is called and worked (checked with NSLog), but no view is displayed.
There is definitely data, that is not the problem. Has something changed with UITableView?

The problem is probably in the way you reuse/allocate your cells in cellForRowAtIndexPath method in case it is not the background colour ?

I had recently changed the UIScrollView to a UITableView, and added in some code to remove all the subviews from the UITableView. This kept the headers as shown in the picture, but not the labels and pictures on the cells.

Related

UITableView didSelectRowAtIndexPath Returns Wrong Row Index (iOS7)

I have a class as "myUIImage" extended from UIScrollView. it has a UIImageView variable.
ViewController delegates "UITableViewDataSource , UITableViewDelegate".
when I add a myUIImage object into all cells in cellforRowAtIndexPath function,(With a cellview that fills whole cell(frame size are same)), the problem occurs.
When i touch one of the rows didSelectRowAtIndexpath returns wrong row index on iOS7. it works well older versions.
I put the example xCode Project here ;
https://www.dropbox.com/s/ps7cc8l51v0grxb/repeatboxDeneme.zip
Thanks For Your Help...
Edit1:
Here is a sample video. Please watch carefully the Logs on down-right side.
http://www.youtube.com/watch?v=5f8-nrlWCIY&feature=youtu.be
This is working perfect on both iOS 6 and iOS7 because i've seen your code. And your code is also perfect. But there is a problem that is you are not using reusable cell. So might be it create problem releated to memory and its not a good practice.
This is no normal behaviour of UITableView. But it looks to me like it just happens if you clicked while scrolling and if it stops it remembers your last click position.
I would recommend you, to insert an UITableView into to your view inside the Storyboard. Connect the Delegate and Datasource of your UITableView with the Filesowner and than just use the methods
numberOfSectionsInTableView
numberOfRowsInSection
cellForRowAtIndexPath
didSelectRowAtIndexPath
Maybe the way you generate your tableview programmatically, there are any attributes missing. The other way you just can look at the InterfaceBuilder settings on the right and can change the settings much easier.

Add explanatory text to UITableView like Things.app

Could anybody hazard a guess as to how exactly the explanatory text was added to the blank state Today screen in the Things to-do list iPhone app? Is it a background image or a view that somehow sits in front of the UITableView?
Thanks in advance.
John, everytime your method numberOfRowsInSection: is called (considering you are using only one section), or everytime you call reloadData to your UITableView, you can do the following (considering that numberOfRows is the total number of rows in your UITableView and that explanationView is the UIView (that you can configure via code or interface builder) you want to show:
[explanationView setHidden:(numberOfRows>0)];
This looks like a view, maybe a UILabel added and hidden and only unhidden when the number of items to be displayed in the list are 0.

UITableViewCell subview not displaying until redraw

This problem is driving me nuts.
I have a prototype UITableViewCell in my storyboard. It contains a bunch of subviews. One of the subviews, a UILabel, is misbehaving.
When the tableview loads and is displayed for the first time, all of the cells look fine. However, as the tableview scrolls down, eventually one of the cells shows up without the UILabel subview. It seems that it is always the first cell that is being recycled.
If I continue scrolling down the tableview, however, as soon as the misbehaving cell is clipped by the top of the tableview (when it begins to be scrolled off the top of the screen), the label appears just as it should.
So it seems that the label is there, and it receives the string that I assign to it in my cellForRowAtIndexPath method. It's just not getting drawn for some reason. I've tried inserting setNeedsDisplay messages in various places, but that hasn't helped.
What is also strange is that I'm using the very same UITableViewCell subclass with a duplicate view hierarchy in the storyboard in a different view controller, and there I don't have any trouble.
Anybody have some idea of how I can start to unravel this mystery?
Thanks!
It sounds like it's only a problem when you use a reusable cell, which means that the values on reusable cells may not be getting set until you're ready to scroll off.

iphone tableview scrolling issue

I have a tableview with imageviews and textviews in each cell. When my view is loaded one of the textviews is invisible. But when I start scrolling the textview appears, so that my view looks as it is supposed to look. Does anyone know why this is happening?
P.S. I have read about reusing cells when scrolling so I have been very careful to construct my cells correctly.
Without code, no one can give you a exact answer. But for a guess....
Is your data is getting populated after your table call cellForRowAtIndexPath? When the cell populates the first time, no data, so the cell is in it's unformatted state. By the time you can interact with the table and scroll it off and on screen (which calls cellForRowAtIndexPath again), the data has been populated and so the cell looks as expected.
You can test this by putting a breakpoint in your cellForRowAtIndexPath method and check to see if your data objects are initialized or still set to nil.

UITableViewCell highlighting issue - iPhone

I have a UITableView and I am having an issue with whenever I try to click on the Cell. When the cell is highlighted it puts some test on top of the text that is already on the cell make the text on the cell hard to read. This only happens while I have the cell highlighted.
Please help me with this issue.
Thanks
I had a similar problem and then realised that I wasn't using the cell dequeuing thing properly and what had happened is that every time the cell is reused a new UIlabel was added and the text from the datasource set to that, but the UILabels from the previous time the cell was showing were still there. But you only see them when the cell is highlighted because when it's not highlighted the background is not clear, but when the cell is highlighted then the UIlabels become clear and you see the other UIlabels that are behind it.
It's quite serious as everytime cell's are dequeued (ie everytime you scroll on the tableview) all of the subviews you've added a duplicated. And it increases memory usage severely.
To fix I used the code from the apple docs on customizing table cells. You have to use tags to retrieve the subviews if the cell is dequeued.:
http://developer.apple.com/iphone/library/documentation/userexperience/conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7-SW15