I'm writing an abstract UITableViewController class and I'd like to write something in viewDidLoad
like
if (self.tableView.contentType == UITableViewContentTypeStaticCells) {
// Do something when table view has static cells
} else {
// Do something when table view has dynamic prototypes
}
But obviously there is no contentType
on UITableView. Is there a way to determine programmatically whether the tableView's storyboard content is static or dynamic?
Just for the curious: [tableViewController valueForKey: @"staticDataSource"]
will get you there, where tableViewController is a UITableViewController.
BUT(!) this might not pass the AppStore and may break without warning as it's not published API.
Update: It seems that checking if checking, if
self == self.tableView.dataSource
while self is a UITableViewController also gives you re requested result.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With