cocoa touch - Multiple UiTableViewCell subclasses in a single UiTableView? Why is this code not working -
Okay here's my issue. I have a table, which is similar to apple's address book.app which is different Use different cell subclasses to display information from. On this special app I have 3 different UiTableViewCell subclasses, all of which have their own designations.
I can not find the right code :-( If I try the instance variable of my cell in the cellherrowpath method it says '(for some' structure or union '' member 'type' Wrong request) Now I think the word 'some' is the root of my problem. (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {static NSString * PoolFacilityCellIdentifier = @ "PoolFacilityCellIdentifier"; Fixed NSString * PoolFacilityAddressCellIdentifier = @ "PoolFacilityAddressCellIdentifier"; And NSString * PoolFacilityPoolCellIdentifier = @ "PoolFacilityPoolCellIdentifier"; NSUInteger section = indexPath.section; // Create a normal containe; For the cell, the next two statements will be inserted into the id cell; // Change the identifier based on the cell type If the pool and prices If there is a need to add anything (address =='s address index) {cell = (poolfilidresscale *) [TableVQRU labeled identifier: poolfilidacecale identifier]; If (cell == zero) {// Load the appropriate cloth for the type of cell. NSArray * nib = [[NSBundle mainBundle] loadNib Nominated: @ "PoolFalalityAdracecel" owner: Self-choice: zero]; (Id object niB) {if ([object isMemberOfClass: [PoolFacilityAddressCell class]]) cell = (PoolFacilityAddressCell *) object; }}} And if (section == Kepul Indexes) {cell = (PoolFilidityCool *) [TableView Reuseball Wide Identifier: PoolFillityPulseCalidentifier]; If (cell == zero) {// Load the appropriate cloth for the type of cell. NSArray * nib = [[NSBundle mainBundle] loadNibNamed: @ "PoolFilancePulsele" owner: self choice: zero]; (Id object niB) {if ([object isMemberOfClass: [PoolFacilityPoolCell class]]) cell = (PoolFacilityPoolCell *) object; }}} {Cell = (poolfilcilial *) [tableview DQUURUCableCalvite identifier: poolfilcieilidentifier]; If (cell == zero) {// Load the appropriate cloth for the type of cell. NSArray * nib = [[NSBundle mainBundle] loadNib Nominated: @ "poolfaccelaceum" owner: self choice: zero]; (Id object niB) (if ([object member of class: [poolfilty cell class]]) cell = (poolfilcilious *) object;}}} any help would be greatly appreciated !!! I import all the header files for my cell subclasses. This code which throws my error (this particular cell.type.text = thePool.type) cell .Type is an eBabelle UIL: thanks, donation
- (UITableViewCell *) Table view:
if (section == Kepul Indexes) {NSMutableArray * thePools = [All processes ObjectForKey: s EctionAsNumber]; if ([Calculate of pin]>;) Set {labels}: [Set the cell setproploted: no]; // ThePool = [thePools ObjectOut Index: line]; Cell.type.text from the label and bridge pool object pool = ThePool.type;}}
There is an article in Matt Gallagher, which is a cleaner way to complete this type of table, which breaks the cell-specific code in its specific classrooms, making it easy to manage. / P >
In your code, this line looks like a hassle
cell.type.text = thePool.type;
thePool is a "pool" object, does it have an asset named "type"? Check that the @ property and @ synthesis are properly set up for "type" in your "pool" object.
Comments
Post a Comment