Custom nib UITableViewCell height

Posted by Chuck on Stack Overflow See other posts from Stack Overflow or by Chuck
Published on 2011-01-06T02:00:57Z Indexed on 2011/01/06 3:54 UTC
Read the original article Hit count: 186

I've created a custom UITableViewCell in IB, linked it to the root view controller's property for it, and set it up in CellForRowAtIndexPath. But the height of my drawn cells doesn't match what I setup in IB, advice? Here's some screenshots and the code. alt text

alt text

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        static NSString *AddressCellIdentifier = @"AddressCellIdent";

    UITableViewCell *thisCell = [tableView dequeueReusableCellWithIdentifier:AddressCellIdentifier];
    if (thisCell == nil) {
        [[NSBundle mainBundle] loadNibNamed:@"AddressCell" owner:self options:nil];
        thisCell = addressCell;
        self.addressCell = nil;
    }

    return thisCell ;
}

addressCell is a @property (nonatomic, assign) IBOutlet UITableViewCell *addressCell;, and is linked up in IB to the file's owner (the table view controller).

I'm using the example from Apple's table view programming guide.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c