Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To make use of the accessoryView - you would need to set the cell's accessoryType to UITableViewCellAccessoryNone deposit a UIButton (with associated image) into the cell and then wire it up to receive user touches. You might use something like the code below as the IBAction response to the cell's UIButton being touched: </p> <pre><code>- (IBAction) accessoryButtonPressed:(id) sender { NSUInteger pathInts[] = { 0,0 }; pathInts[1] = self.currentselectedrow; // ivar set when tableview row last selected NSIndexPath* indexPath = [NSIndexPath indexPathWithIndexes:pathInts length:2]; [self tableView:mytableview accessoryButtonTappedForRowWithIndexPath:indexPath]; } </code></pre> <p>The UIButton would be wired to execute this glue code by way of a line inside your tableview's "cellForRowAtIndexPath:" function</p> <pre><code>[thecell setButtonTarget:self action:@selector(accessoryButtonPressed:)]; </code></pre> <p>One thing I noticed is that the UIButton seems to want a 'swipe right' versus a simple 'tap' touch in order to trigger the event - but it could be my beta iOS that's the problem. Note that I had added a UIButton* object named 'cell_accessoryButton' to the Custom Cell source.</p> <p>In the cell's source you'd support the 'setButtonTarget' call with code like this: </p> <pre><code>- (void) setButtonTarget:(MyViewController*)inTarget action:(SEL) inAction { [self.cell_accessoryButton addTarget: inTarget action: (SEL) inAction forControlEvents: UIControlEventTouchUpInside]; } </code></pre> <p>It's so much easier to just use the accessoryType reference and let iOS do the heavy lifting - but, if you want a custom graphic, etc - this is another path that works. </p>
    singulars
    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. This table or related slice is empty.
    1. This table or related slice is empty.
    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