Hi tarekskr,
I think i am missing something here. I have a "normal" cell that once touched it loads a new SCT page. that works fine.
In order to changed to a custom cell i changed this in my .h file (i think that is correct?):
to
SCTableViewModelDataSource
I have coded the custom cell like this:
- (SCControlCell *)tableViewModel:(SCTableViewModel *)tableViewModel customCellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// Create & return a custom cell based on the cell in ContactOverviewCell.xib
NSDictionary *contactOverviewBindings = [NSDictionary
dictionaryWithObjects:[NSArray arrayWithObjects:@"time",@"description",@"location", nil]
forKeys:[NSArray arrayWithObjects:@"1",@"2",@"3", nil]]; // 1,2,3 are the control tags
SCControlCell *contactOverviewCell = [SCControlCell cellWithText:nil withBoundObject:nil withObjectBindings:contactOverviewBindings
withNibName:@"CustomCell"];
return contactOverviewCell;
}
This all works fine.
However, now when i touch a row it will not process didSelectRowAtIndexPath function. It does nothing.
-(void)tableViewModel:(SCTableViewModel *)tableViewModel didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SCTableViewCell *cell = [tableViewModel cellAtIndexPath:indexPath];
// define the target view controller
HCAViewController *view = [[HCAViewController alloc] initWithNibName:@"HCAViewController" bundle:nil];
view.flight = cell.textLabel.text;
// set target view controller title
view.navigationItem.title = cell.textLabel.text;
// push target view onto nav controller
[[self navigationController] pushViewController:view animated:YES];
[view release];
}
So how do i?
1. load the next SCT page when row selected?
2. When row selected in a custom cell how can i get access to the cell data so i can pass it to the next SCT page: For example:
view.location = cell.location.text;