I use [UITableView registerClass: forReuseIdentifier:]both [UITableView dequeueReusableCellWithIdentifier:]to queue and delete from UITableViewCells.
For example, in viewDidLoad:
[self.storeTableView registerClass:[StoreLineGraphCell class] forCellReuseIdentifier:@"StoreLineGraphCellIdentifier"];
And in cellForRowAtIndexPath:
StoreLineGraphCell *cell = (StoreLineGraphCell*)[self.storeTableView dequeueReusableCellWithIdentifier:@"StoreLineGraphCellIdentifier"];
In this case, the initializer initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifieris called for the UITableViewCell. The problem is that I need to use a custom initializer to create a cell with the necessary parameters. For example, the ability to do something like this:
StoreLineGraphCell *cell = [[StoreLineGraphCell alloc] initWithReuseIdentifier:@"StoreLineGraphCell" isLocked:YES isUpcoming:YES];
This is not possible using the template registerClassand dequeue. I would like to save it in the initializer, since it should be run only once, not every time the cell is deleted. Is there any way to do this?