Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you are instantiating the <code>UITableView</code> yourself, just instantiate the library class instead. For example, if you said this:</p> <pre><code>UITableView *tableView = [[UITableView alloc] initWithFrame:frame style: UITableViewStylePlain]; </code></pre> <p>then do this instead:</p> <pre><code>LibraryTableView *tableView = [[LibraryTableView alloc] initWithFrame:frame style:UITableViewStylePlain]; </code></pre> <p>If <code>LibraryTableView</code> provides some other, more specialized <code>initWith…</code> method, you may need to use that instead.</p> <p>If you're storing a reference to the table view in a property or instance variable, you may also want to change the type of that property or instance variable from <code>UITableView *</code> to <code>LibraryTableView *</code>.</p> <h3>UPDATE</h3> <p>I believe if you're using a <code>UITableViewController</code>, you can create your own table view and assign it to the controller's <code>tableView</code> property:</p> <pre><code>UITableViewController *tvc = ...; tvc.tableView = [[LibraryTableView alloc] initWithFrame:frame style:UITableViewStylePlain]; </code></pre> <h3>UPDATE 2</h3> <p>In your <code>viewDidLoad</code>, you're creating an <code>FMMoveTableView</code>, but you're not storing it in the view controller's <code>tableView</code> property. You <strong>must</strong> store it in the view controller's <code>tableView</code> property, and when you do, the view controller will <em>automatically</em> set the table view's <code>dataSource</code> and <code>delegate</code> to <code>self</code>.</p> <pre><code>-(void) viewDidLoad{ self.tableView = [[FMMoveTableView alloc] init]; taskArray = [[NSMutableArray alloc] init]; } </code></pre> <p>In your <code>tableView:cellForRowAtIndexPath:</code>, you need to instantiate an <code>FMMoveTableViewCell</code>, not a <code>UITableViewCell</code>. You send the <code>alloc</code> message to the class you want to instantiate:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; if (!cell) { cell = [[FMMoveTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"Cell"]; } // etc. </code></pre> <p>If you have your own custom subclass of <code>FMMoveTableViewCell</code>, instantiate that instead.</p>
 

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