Adding action to NICellFactory

50 views
Skip to first unread message

Nephantes

unread,
Nov 6, 2012, 10:55:40 AM11/6/12
to nimb...@googlegroups.com

Hi,

How can I add an action to the Cells defined with NICellFactory in NetworkBlockCellsViewController example.

I just want to attach action like NIPushControllerAction to the cells in the UITableView.


    // Set up our explicit mapping of NIDrawRectBlockCellObject -> NetworkDrawRectBlockCell.

    _cellFactory = [[NICellFactory alloc] init];

    [_cellFactory mapObjectClass:[NIDrawRectBlockCellObject class]

                     toCellClass:[NetworkDrawRectBlockCell class]];

      

    // Notice that we're passing the _cellFactory instance rather than (id)[NICellFactory class]

    // now.

    _model = [[NITableViewModel alloc] initWithListArray:tableContents

                                                delegate:_cellFactory];


Best,

Thanks,

Neph

Nephantes

unread,
Nov 6, 2012, 1:28:03 PM11/6/12
to nimb...@googlegroups.com
I did it actually by adding below under _model

      _actions = [[NITableViewActions alloc] initWithTarget:self];

      [_actions attachToClass:[NIDrawRectBlockCellObject class]

              navigationBlock:NIPushControllerAction([ContentModesNetworkImageViewController class])];


and

added 

  self.tableView.delegate = [self.actions forwardingTo:self];

into the viewDidLoad and worked.

Thanks anyways.

Best,

Neph

Reply all
Reply to author
Forward
0 new messages