Permalink
Browse files

Add method for awakeFromNib.

Big fix, this bug affects anyone creating grid views in a nib.
  • Loading branch information...
1 parent f2cdbf2 commit 5d321c7376d0000936aebc092a0a451e8c8b54cf @danielctull committed Oct 29, 2010
Showing with 12 additions and 3 deletions.
  1. +12 −3 DTGridView/DTGridView.m
View
@@ -25,6 +25,7 @@ - (NSString *)description {
@end
@interface DTGridView ()
+- (void)dctInternal_setupInternals;
- (void)loadData;
- (void)checkViews;
- (void)initialiseViews;
@@ -74,7 +75,18 @@ NSInteger intSort(id info1, id info2, void *context) {
- (id)initWithFrame:(CGRect)frame {
if (!(self = [super initWithFrame:frame])) return nil;
+
+ [self dctInternal_setupInternals];
+
+ return self;
+}
+
+- (void)awakeFromNib {
+ [self dctInternal_setupInternals];
+}
+
+- (void)dctInternal_setupInternals {
gridRows = [[NSMutableArray alloc] init];
rowPositions = [[NSMutableArray alloc] init];
rowHeights = [[NSMutableArray alloc] init];
@@ -83,9 +95,6 @@ - (id)initWithFrame:(CGRect)frame {
freeCells = [[NSMutableArray alloc] init];
cellInfoForCellsOnScreen = [[NSMutableArray alloc] init];
-
- return self;
-
}
- (void)setFrame:(CGRect)aFrame {

0 comments on commit 5d321c7

Please sign in to comment.