GMGridView: custom cell content
===

I have a really silly question to ask about the GMGridView.  I can't figure out how to customize the contents of the cell in a meaningful way.  Getting the content in is not a problem, but I am unable to position anything within the cell.

I am overriding the GMGridView:cellForItemAtIndex: method and adding a "title" and "description" as the cell contents.  However, when I go to set the origin of these, it is unable to get the bounds of cell.contentView (as it is not yet rendered).

How do you go about customizing the contents of the cell when the grid is first loaded?

Below is the code for the method:

    - (GMGridViewCell *)GMGridView:(GMGridView *)gridView cellForItemAtIndex:(NSInteger)index {
        CGSize size = [self GMGridView:gridView sizeForItemsInInterfaceOrientation:[[UIApplication sharedApplication] statusBarOrientation]];
        
        GMGridViewCell *cell = [gridView dequeueReusableCell];
        
        if (!cell) {
            cell = [[GMGridViewCell alloc] init];
            cell.deleteButtonIcon = [UIImage imageNamed:@"close_x.png"];
            cell.deleteButtonOffset = CGPointMake(-15, -15);
            
            UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
            view.backgroundColor = [UIColor grayColor];
            view.layer.masksToBounds = YES;
            view.layer.cornerRadius = 0;
            
            cell.contentView = view;
        }
        
        [[cell.contentView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
        
        CGRect titleBounds = CGRectMake(0, 0, cell.contentView.bounds.size.width, cell.contentView.bounds.size.height / 2);
        
        CGRect descBounds = CGRectMake(0, cell.contentView.bounds.size.height / 2, cell.contentView.bounds.size.width, cell.contentView.bounds.size.height / 2);
        
        NSLog(@"cell.contentView.bounds: %@", cell.contentView.bounds);
        
        UILabel *label = [[UILabel alloc] initWithFrame:titleBounds];
        label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        label.text = (NSString *)[[self.gridData objectAtIndex:index] objectForKey:@"Title"];
        label.textAlignment = UITextAlignmentCenter;
        label.backgroundColor = [UIColor clearColor];
        label.textColor = [UIColor blackColor];
        label.highlightedTextColor = [UIColor whiteColor];
        label.font = [UIFont boldSystemFontOfSize:20];
        [cell.contentView addSubview:label];
        
        UILabel *lbl_description = [[UILabel alloc] initWithFrame:descBounds];
        lbl_description.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        lbl_description.text = (NSString *)[[self.gridData objectAtIndex:index] objectForKey:@"Description"];
        lbl_description.textAlignment = UITextAlignmentCenter;
        lbl_description.backgroundColor = [UIColor clearColor];
        lbl_description.textColor = [UIColor blackColor];
        lbl_description.highlightedTextColor = [UIColor whiteColor];
        lbl_description.font = [UIFont boldSystemFontOfSize:20];
        [cell.contentView addSubview:lbl_description];
        
        
        return cell;
    }