Question

I had a class called OptionsTableViewController which inherited UITableViewController. I changed the superclass to UIViewController implementing the UITableViewDelegate and UITableViewDataSource protocols, because I needed the tableView to be in a specific position.

Now some table cells have a UISwitch as accessoryView. The switch is an instance variable, initialized With CGRectZero.

When changing the superclass to UIViewController the switches are not shown. But when I also rename the class (to OptionsViewController f. e.) it works.

Does anybody know where this strange behavior comes from? I also tried to clean the project and I even deleted the build folder - but it seems, that the only solution is to rename the class.

I had a similar problem before, where the whole table view would not be shown unless the class was renamed.

Was it helpful?

Solution 2

I found the reason for this problem. Although searching through the project XCode wouldn't find any files named OptionsTableViewController, but I found it included under Targets -> AppName. The file wouldn't disappear after Clean All Targets, so it is good to know that there still remain parts in there.

OTHER TIPS

Did you check to see if the names OptionsTableViewController and OptionsViewController are used anywhere else in your entire project, including in Interface builder nib files? Did you change all the names, as appropriate?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top