Skip to content

Instantly share code, notes, and snippets.

@millenomi
Created April 8, 2009 14:19
Show Gist options
  • Save millenomi/91790 to your computer and use it in GitHub Desktop.
Save millenomi/91790 to your computer and use it in GitHub Desktop.
//
// L0NibTableViewCell.h
//
#import <UIKit/UIKit.h>
@interface L0NibTableViewCell : UITableViewCell {
IBOutlet UIView* innerView;
}
- (id) initWithNibName:(NSString*) name bundle:(NSBundle*) bundle reuseIdentifier:(NSString*) ident;
@end
// ----
//
// L0NibTableViewCell.m
//
#import "L0NibTableViewCell.h"
@implementation L0NibTableViewCell
- (id) initWithNibName:(NSString*) name bundle:(NSBundle*) bundle reuseIdentifier:(NSString*) ident;
{
if (self = [super initWithFrame:CGRectMake(0, 0, 320, 50) reuseIdentifier:ident]) {
if (!bundle) bundle = [NSBundle mainBundle];
[bundle loadNibNamed:name owner:self options:[NSDictionary dictionary]];
NSAssert(innerView, @"The inner view needs to be loaded");
innerView.frame = self.contentView.bounds;
[self.contentView addSubview:innerView];
[innerView release];
innerView = nil;
}
return self;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment