Skip to content

didSelect method not working after subclassing MDSpreadViewCell and MDSpreadViewHeaderCell #24

@afsalme

Description

@afsalme

I want to customize MDSpreadView display. So I subclasses MDSpreadViewCell and MDSpreadViewHeaderCell classes and loaded custom nib view for cells. (Same as we do to customize UITableViewCell).

Code I used is below
*MDSpreadViewCellCustom is subclass of MDSpreadViewCell


  • (MDSpreadViewCell *)spreadView:(MDSpreadView *)aSpreadView cellForRowAtIndexPath:(MDIndexPath *)rowPath forColumnAtIndexPath:(MDIndexPath *)columnPath
    {
    //if (rowPath.row >= 25) return nil; // use spreadView:objectValueForRowAtIndexPath:forColumnAtIndexPath below instead

    static NSString *cellIdentifier = @"Cell";

    MDSpreadViewCellCustom cell = (MDSpreadViewCellCustom)[aSpreadView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (cell == nil) {
    cell = [[[MDSpreadViewCellCustom alloc] initWithStyle:MDSpreadViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
    NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:@"MDSpreadViewCellCustom" owner:self options:nil];
    cell = [nibViews objectAtIndex:0];
    }
    return cell;
    }

    Please help me to figure out the issue and to customize the view.
    Below is image of app after loading custom nib file
    screen shot 2013-10-02 at 10 38 15 am

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions