You said:
i just define the dataSource in the Class
Are you also settings the tableView's datasource to this property?
(It looks like you aren't)
Otherwise...
For both functions, zero is a valid return value...
...so that suggests there may be a problem with the property you are accessing?
You said:
my dataSource is empty
It's not clear what you mean by this.
If it's really empty, isn't a crash an appropriate response?
• Are you sure that both methods are being called?
• Have you checked the Int value that they return?
• Are you checking to see that datasource[section] exists, before you reference it?!
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: