Permalink
Browse files

Allow setting the nibName on data renderer.

  • Loading branch information...
1 parent 5e3682e commit c7dab1e8903cc8ab243d8fc2a778aabad60342a0 @jasperblues jasperblues committed Jun 15, 2012
@@ -20,6 +20,7 @@
NSMutableArray* _filteredListContent;
NSUInteger _cellHeight;
+ NSString* _nibNameForTableCell;
}
@@ -43,6 +44,8 @@
*/
@property(nonatomic, strong, readonly) UISearchDisplayController* searchController;
+@property(nonatomic, strong) NSString* nibNameForTableCell;
+
/**
* Injection point for loading custom table cells from a nib.
*/
@@ -74,10 +77,6 @@
*/
- (void) filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope;
-/**
-* Abstract method that returns the name of the nib to use.
-*/
-- (NSString*) nibNameForTableCell;
- (UITableViewCell*) loadTableCellFromNib;
@@ -11,7 +11,6 @@
#import "expanz_ui_AbstractDataRenderer.h"
#import "expanz_model_AbstractData.h"
-#import "expanz_ui_NavigationManager.h"
@implementation expanz_ui_AbstractDataRenderer
@@ -21,6 +20,7 @@ @implementation expanz_ui_AbstractDataRenderer
@synthesize activityName = _activityName;
@synthesize searchController = _searchController;
@synthesize tableCell = _tableCell;
+@synthesize nibNameForTableCell = _nibNameForTableCell;
/* ================================================== Initializers ================================================== */
@@ -31,6 +31,7 @@ - (Row*) tableView:(UITableView*)tableView rowForIndexPath:(NSIndexPath*)indexPa
- (void) thumbnailTableViewCell:(ThumbnailTableCell*)cell setThumbnailImageFor:(Row*)row;
@end
+
/* ================================================================================================================== */
@implementation expanz_ui_GridDataRenderer
@@ -147,7 +148,10 @@ - (void) filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
}
- (NSString*) nibNameForTableCell {
- return @"DefaultTableCellForGridData";
+ if ([_nibNameForTableCell length] == 0) {
+ _nibNameForTableCell = @"DefaultTableCellForGridData";
+ }
+ return _nibNameForTableCell;
}
@@ -111,7 +111,10 @@ - (void) filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
}
- (NSString*) nibNameForTableCell {
- return @"DefaultTableCellForTreeData";
+ if ([_nibNameForTableCell length] == 0) {
+ _nibNameForTableCell = @"DefaultTableCellForTreeData";
+ }
+ return _nibNameForTableCell;
}
/* ================================================== Private Methods =============================================== */

0 comments on commit c7dab1e

Please sign in to comment.