views:

25

answers:

2

Hello everyone,

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.

A: 

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?

hotpaw2
I used the _Refactor..._ option of XCode and it seems, that there is no other appearance of OptionsTableViewController (except in comments) - I used the Edit -> Find -> Find in Project Feature to check on that. I also deleted the nib file as I don't use it.
marikaner
A: 

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.

marikaner