Skip to content

PrettyTableViewCell #48

@jayrparro

Description

@jayrparro

Xcode 6, iOS 8, using PrettyTableViewCell and the app is crashing related to KVO on line 481 -
any idea?

- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 
{
    if ([keyPath isEqualToString:@"frame"]) 
    {        
        UIView *contentView = (UIView *) object;
        CGRect originalFrame = contentView.frame;

        float shadowMargin = [self shadowMargin];

        float y = contentView_margin;
        switch (self.position) {
            case PrettyTableViewCellPositionTop:
            case PrettyTableViewCellPositionAlone:
                y += shadowMargin;
                break;
            default:
                break;
        }
        float diffY = y - originalFrame.origin.y;

        if (diffY != 0)
        {
            CGRect rect = CGRectMake(originalFrame.origin.x+shadowMargin,
                                     originalFrame.origin.y+diffY,
                                     originalFrame.size.width - shadowMargin*2,
                                     originalFrame.size.height- contentView_margin*2 - [PrettyTableViewCell neededHeightForPosition:self.position tableStyle:_tableViewStyle]);
            contentView.frame = rect; // --> crash here!
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions