iphone - Custom Cell from Nib UITableView -


I am trying different ways with no success of changing the following code ...

< P> I have a nib file which works properly if I set all the cells on it but I only need one of the switch statements for custom STATE Nib file. Any ideas?

  - (UITableViewCell *) TableView: (UITableView *) table view cellheroutoutpath: (NSIndexPath *) Index pathway {NSUntengar line = [index line]; NSInteger section = [index section]; UITableViewCell * cell; Switch (section) {case 0: cell = [tableView dequeueReusableCellWithIdentifier: @ "any-cell"]; Cell = [[[UITableViewCell alloc] initWithFrame: CGRectZero reuseIdentifier: @ "any cell"] autorelease]; Cell.text = [Shows ObjectsOutIndex: Line]; break; Case 1: Cell = [Tableview Décures reusable cell death identifier: @ "any cell"]; Cell = [[[UITableViewCell alloc] initWithFrame: CGRectZero reuseIdentifier: @ "any cell"] autorelease]; Cell.text = [Shows ObjectsOutIndex: Line]; break; Default: cell = [Tableview DeWewer re-qualified CellWithIdentifier: @ "any cell"]; Cell = [[[UITableViewCell alloc] initWithFrame: CGRectZero reuseIdentifier: @ "any cell"] autorelease]; Cell.text = [Shows ObjectsOutIndex: Line]; break; } Return cell; }  

You will need to do two things:

  1. Make a separate cell identifier for the cell that you want to use with nibb, using "any cell" can result in your cell being reused for different lines.
  2. Instead of UITableViewCell's initWithFrame: reuseIdentifier: method, you need to start the cell from your nibb. Check the section on using Nibs. In addition, although it is not technically necessary, the initWithFrame: reuseIdentifier: method of UITableViewCell is deprecated in favor of InitWithStyle: ReuseIdentifier: .


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -