Code Wiget
Code Wiget

Reputation: 1682

Swift - Static table view cells throwing index out of range error when new section is added

Here is my console output:

fatal error: Index out of range

The table array is full of static cells, and if I add more rows to the sections my app still works fine. However, if I add an additional section I receive this error. Is there a limit to the number of sections you can have in a table view?

Thanks for your help

E: I currently have 5 table view sections, if that helps

Upvotes: 0

Views: 59

Answers (1)

郭妙友
郭妙友

Reputation: 41

func numberOfSections(in: UITableView)

Asks the data source to return the number of sections in the table view.

Upvotes: 1

Related Questions