Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Sadly that method doesn't get called unless the internal button type provided when you use one of the predefined types is tapped. To use your own, you'll have to create your accessory as a button or other UIControl subclass (I'd recommend a button using <code>-buttonWithType:UIButtonTypeCustom</code> and setting the button's image, rather than using a UIImageView).</p> <p>Here's some things I use in Outpost, which customizes enough of the standard widgets (just slightly, to match our teal colouring) that I wound up doing my own UITableViewController intermediary subclass to hold utility code for all other table views to use (they now subclass OPTableViewController).</p> <p>Firstly, this function returns a new detail disclosure button using our custom graphic:</p> <pre><code>- (UIButton *) makeDetailDisclosureButton { UIButton * button = [UIButton outpostDetailDisclosureButton]; [button addTarget: self action: @selector(accessoryButtonTapped:withEvent:) forControlEvents: UIControlEventTouchUpInside]; return ( button ); } </code></pre> <p>The button will call this routine when it's done, which then feeds the standard UITableViewDelegate routine for accessory buttons:</p> <pre><code>- (void) accessoryButtonTapped: (UIControl *) button withEvent: (UIEvent *) event { NSIndexPath * indexPath = [self.tableView indexPathForRowAtPoint: [[[event touchesForView: button] anyObject] locationInView: self.tableView]]; if ( indexPath == nil ) return; [self.tableView.delegate tableView: self.tableView accessoryButtonTappedForRowWithIndexPath: indexPath]; } </code></pre> <p>This function locates the row by getting the location in the table view of a touch from the event provided by the button and asking the table view for the index path of the row at that point.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload