phi
phi

Reputation: 10733

In a xib file that only contains a cell, is it the File Owner or the actual view that must be set as my UITableViewCell subclass?

I have PhoneCell.h that is a UITableViewCell subclass and then PhoneCell.xib that only contains a cell. I read here and here that the custom class should not be set for the File Owner but for the actual subview like that:

enter image description here

The thing is, when I do that and I try to right-click-drag from "Phone Cell" to the UILabel/UIButton instances, I don't get the regular popup that suggests which outlets match to connect, like this for reference:

enter image description here

However, if I just right click on "Phone Cell" I get the popup as usual and from there I can connect the outlets and everything seems to work fine:

enter image description here

Is this some sort of glitch in Interface Builder or is it a sign that I am doing something that is not expected?

Upvotes: 0

Views: 93

Answers (2)

TomSwift
TomSwift

Reputation: 39502

This is just an odd behavior in IB. A handful of things like this that used to work pre- XCode5 are broke in the current XCode5. Until fixed (?), just right click to show the outlets popover and make your connections from that.

In your cell XIB make the UITableViewCell classname refer to your custom class. You don't need to touch the XIB owner.

Upvotes: 1

ccguo
ccguo

Reputation: 1

In fact, you are wrong, in UITableViewController, you use the files right owner variables can be connected directly to the socket, the appearance of this place is very normal, because the XIB (tableview) just belong to UITableViewController an instance variable, XIB files (the owner) belongs to UITableViewController class, XIB = tabelView (view), the local test class with class instance variables,

TableViewcell: phone xib = = UITablViewCell, xib is equal to [UITableViewCell alloc], the local phone. Xib and classes (phone. h, phone, m) to try the same thing, they do not exist files owner relations, is the same individual, so you can't connect

Upvotes: 0

Related Questions