I am having this issue with loading up table content in UITableViewController
. I have created UITableViewController
without the xib. In loadView
I am calling a function which generates the array of data to be displayed. And from that array in tableView:cellForRowAtIndexPath:
I am trying to load the cells. But somehow I am getting nothing on table. Besides that when I set break point for about call, it seems not get called. Can anyone tell what am I doing wrong here?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
-tableView:cellForRowAtIndexPath:
gets called whenever new cell is needed, whether when first filling the screen with cells, or when a new cell is scrolled into the screen, but it will never get called if you haven't returned a proper number of sections and rows for your table view, as they will be 0 by default.cellforrowatindexpath is called when building the table. Have you set the delegate of the table to self? Have you added to your .h?
as eimantas said, you have to set the "dataSource" delegate of your UITableView = (pointing to) yourClass with the tableView:cellForRowAtIndexPath method...
it's the method called whenever a new cell is needed (the first time you see your table it creates a needed number of cells to cover the whole height of your table height), then it's called when user scroll the table (not to create new cells, but to reuse the old cells with the new data needed)