Created
August 4, 2009 14:45
-
-
Save twoism/161285 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
// | |
// UITableViewCell+CustomNib.h | |
// UBlossom | |
// | |
// Created by Christopher Burnett on 7/22/09. | |
// Copyright 2009 digital scientists, llc. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface UITableViewCell (CustomNib) | |
- (id)initWithNibName:(NSString*)nibName reuseIdentifier:(NSString *)reuseIdentifier; | |
@end | |
// | |
// UITableViewCell+CustomNib.m | |
// UBlossom | |
// | |
// Created by Christopher Burnett on 7/22/09. | |
// Copyright 2009 digital scientists, llc. All rights reserved. | |
// | |
#import "UITableViewCell+CustomNib.h" | |
@implementation UITableViewCell(CustomNib) | |
- (id)initWithNibName:(NSString*)nibName reuseIdentifier:(NSString *)reuseIdentifier{ | |
if (self = [self initWithFrame:CGRectZero reuseIdentifier:reuseIdentifier]) { | |
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil]; | |
for(id currentObject in topLevelObjects) { | |
if([currentObject isKindOfClass:[self class]]) { | |
self = currentObject; | |
break; | |
} | |
} | |
} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment