I had this same issue and the way I got around it was by subclassing the item cell (so for you it d be TTTableSubtitleItemCell
and overriding the setObject
method to manually include the disclosure button as follow:
- (void)setObject:(id)object {
if (_item != object) {
[_item release];
_item = [object retain];
[super setObject:object];
self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
我也利用这一方法,允许自己选择的风格仍然是蓝色的,尽管我当时没有按预期的方式处理URL。 这样做还只是增加
self.selectionStyle = UITableViewCellSelectionStyleBlue;
在其他呼吁之后的权利。
Note you ll also need to add the mapping between the items you care about and this new custom item cell in your data source. This requires overriding one method in a custom data source. If you want all of your TTTableSubtitleItem
s to have the disclosure button, you can map TTTableSubtitleItem
to your new custom item cell. Otherwise just create a custom subclass of TTTableSubtitleItem
as well that doesn t make any changes to it. Assuming your two new subclasses are CustomItem
and CustomItemCell
your data source would override the following method to look like so:
- (Class)tableView:(UITableView *)tableView cellClassForObject:(id)object {
if ([object isKindOfClass:[CustomItem class]]) {
return [CustomItemCell class];
} else {
return [super tableView:tableView cellClassForObject:object];
}
}
Hope this helps