I do not understand why in the following code indexPath.sectionreconfigures a null value.
override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell? {
NSLog("Index Path %@", indexPath)
NSLog("Index Path Section %@", indexPath.section)
Following this question, I also tried the following to access the value of the section:
if let section = indexPath?.section {
NSLog("Index Path Section %@", section)
}
I have a table with 2 sections with 1 row in each section. At the first iteration, where path = 0 - 0, the log shows Index Path Section (null). At the second iteration, where the path = 1 - 0program will work.
I'm not trying to do something complicated, I just need to access the value of the section so that I can conditionally return the correct cell type.
source
share