English 中文(简体)
320 当我使用吗? 反对: 项目
原标题:three20 How do I show a Disclosure Button when i use didSelectObject on TTTableSubtitleItem

我利用TTTable Sub entitledItem把囚室打上桌子。 然后,我使用“SelectObject to sent an Object to the details view controller”。 为了防止电文两次发送,我必须把TTTable SubtitleItem URL确定为零。 由于这种披露,布顿不会显示出来?

    [TTTableSubtitleItem itemWithText:[chunks objectAtIndex: 0] 
                                 subtitle:@"Link To Website"
                                 imageURL:@""
                             defaultImage:[UIImage imageNamed:@"map.png"]
                                      URL:nil 
                             accessoryURL:@"http://www.google.com"];
最佳回答

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 TTTableSubtitleItems 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

问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签