Created
April 8, 2009 14:19
-
-
Save millenomi/91789 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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