ios - dataSource is nil in initWithCoder -


i have following initwithcoder implementation depends on callback of datasource method. somehow datasource nil , datasource methods aren't called. i'm using storyboard , therefor have overwritten initwithcoder-method.

- (id)initwithcoder:(nscoder *)adecoder {     self = [super initwithcoder:adecoder];     if (self) {         nsuinteger rows = 0;         nsuinteger columns = 0;          if (self.datasource && [self.datasource respondstoselector:@selector(numberofheaderrowsinspreadsheetview:)]) {             rows = [self.datasource numberofheaderrowsinspreadsheetview:self];         }         if (self.datasource && [self.datasource respondstoselector:@selector(numberofheadercolumnsinspreadsheetview:)]) {             columns = [self.datasource numberofheadercolumnsinspreadsheetview:self];         }         [self setupwithnumberofheaderrows:rows numberofheadercolumns:columns];     }     return self; } 

does has clue?

thanks in advance.

i wouldn’t surprised if storyboard connections haven’t been made yet in -initwithcoder: (although haven’t tested it). try doing checks later, in viewwillappear:.


Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

java - gson parse items from comma-separated-value string within a json value -

Validation in java Error log in register -