Welcome, Guest
Username Password: Remember me

No initWithCoder?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: No initWithCoder?

No initWithCoder? 1 year, 8 months ago #1

SCTableViewController only implements initWithStyle: and doesn't seems to work when it's loaded from a NIB file. In said case, tableViewModel isn't initialized at all.

I solved the problem by adding the initWithCoder method to SCTableViewController.m:

- (id)initWithCoder:(NSCoder *)aDecoder {
if (self = [super initWithCoder:aDecoder]) {
tableViewModel = [[SCTableViewModel alloc] initWithTableView:self.tableView
withViewController:self];
delegate = nil;
navigationBarType = SCNavigationBarTypeNone;
navigationBar = nil;
addButton = nil;
cancelButton = nil;
doneButton = nil;
cancelButtonTapped = FALSE;
doneButtonTapped = FALSE;
}
 
return self;
}


Is this a bug, or is there another way to accomplish this?
  • quanganhdo
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 0

Re: No initWithCoder? 1 year, 8 months ago #2

Thanks a lot Anh for sharing this with us.

This all boils down to how SCTableViewController was initially designed. Initially, it was created just for Sensible TableView's internal use. Then, we discovered that a surprising number of customers are actually starting to use it in their own applications! We are now trying our best to have it function correctly for users to use independently of STV.

Your code will be added to our next release to help solve this problem. We're also happy to get your feedback on any other issues you face while using this class independently.

Thanks again!
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
  • Page:
  • 1
Time to create page: 1.24 seconds