Created
April 23, 2009 17:26
-
-
Save millenomi/100617 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { | |
| // In IB, make a file with this class as the File's Owner and connect a view | |
| // to the innerView outlet. This view will be resized to fill the cell's | |
| // content view. | |
| 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