Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom UITableViewCell Not Using .xib (Most Likely Because of Flaw in init Method)
    primarykey
    data
    text
    <p>I subclassed the UITableViewCell in order to customize it, but I think I'm missing something because: 1) It's not working and 2) There are a couple of things I'm confused on. Along with customizing the look of the .xib file, I also changed the backgroundView, and that part is working fine. The part that I least understand/am most confused about is the init method, so I posted that here. If it turns out that is correct, please tell me so I can post more code that <em>may</em> be the cause.</p> <p><strong>This is the init method, which I customized.</strong> I'm sort of confused around the "style" idea and I think I'm just returning a normal UITableViewCell with a different backgroundView. I mean, there's nothing in there that refers to the .xib or does anything but change the .backgroundView from the self:</p> <pre><code>- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier wait: (float) wait fadeOut: (float) fadeOut fadeIn: (float) fadeIn playFor: (float) playFor { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { CueLoadingView* lview = [[CueLoadingView alloc] initWithFrame:CGRectMake(0, 0, 320, 53)]; self.backgroundView = lview; [self setWait:wait]; // in turn edits the lview through the backgrounView pointer [self setFadeOut:fadeOut]; [self setFadeIn:fadeIn]; [self setPlayFor:playFor]; } return self; } </code></pre> <p>Other than the .xib and several setters and getters, this is the only real part of my code, that relates to retrieving a cell.</p> <p>Additional Information:</p> <p>1) This is my .xib, which is linked to the class. <img src="https://i.stack.imgur.com/BddA5.png" alt="enter image description here"></p> <p>2) This is the code that calls/creates the UITableView (the delegate/view controller):</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *simpleTableIdentifier = @"CueTableCell"; CueTableCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; if (cell == nil) { cell = [[CueTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier wait:5.0 fadeOut:1.0 fadeIn:1.0 playFor:10.0]; [cell updateBarAt:15]; } return cell; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload