Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The easiest way to implement that is to use Delegates.</p> <p>Define a protocol in your CustomTableCell.h like this:</p> <pre><code>@protocol CustomTableCellDelegate &lt;NSObject&gt; @required - (void)reloadMyTable; @end </code></pre> <p>The next step is to provide a delegate var:</p> <pre><code>@interface CustomTableCell : UITableViewCell { id&lt;CustomTableCellDelegate&gt; delegate; } @property (assign) id&lt;CustomTableCellDelegate&gt; delegate; </code></pre> <p>Make shure you synthesize your delegate-Variable in the CustomTableCell.m.</p> <p>Now you have a Delegate Defined. There are three remaining steps: </p> <p>When you create your cell you have to set the delegate for this cell like</p> <pre><code>cell.delegate = self; </code></pre> <p>Make shure your TableViewController implements your CustomTableCellDelegate. If you do this you will be forced to implement the - (void)reloadMyTable in your TableViewController:</p> <pre><code>- (void)reloadMyTable { [self.tableView reloadData]; } </code></pre> <p>The last step is to call this method from your CustomTableCell like this:</p> <pre><code>if (self.delegate != NULL &amp;&amp; [self.delegate respondsToSelector:@selector(reloadMyTable)]) { [delegate reloadMyTable]; } </code></pre> <p>More about Delegation <a href="http://developer.apple.com/iphone/library/documentation/General/Conceptual/DevPedia-CocoaCore/Delegation.html#//apple_ref/doc/uid/TP40008195-CH14" rel="noreferrer">here</a>.</p> <p>In short: You define a protocol in your CustomTableViewCell, which is implemented by the TableViewController. If you send a method-message to your delegate, this message will be send to your TableViewController.</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