ios - How to instantiate UITableViewCell with custom class in switch section -
I need to create an object at the beginning of the But in this case the cell is The problem is Even if you put the cell as What you can do: cellForRowAtIndexPath switch section: < Pre>
switch (indexPath.section) {case detailControllerAddressSection: {NSString * address = [auto address text]; UITableViewCell * cell; If (UI_USER_INTERFACE_IDIOM () == UIUserInterfaceIdiomPad) {if (IS_OS_7_OR_LATER) {cell = (CustomDetailCell *) [tableView dequeueReusableCellWithIdentifier: @ "AddressCell" forIndexPath: indexPath]; Cell.mainLabel.text = Address; Cell.detailLabel.text = [Object data for Self Distance Message: self.objectData]; } Else {UniversalAddressCell * cell = (UniversalAddressCell *) [Talikadrishy dequeueReusableCellWithIdentifier: @ "UniversalAddressCell" forIndexPath: indexPath]; Cell.backgroundView = [Self cell backgroundground view: indexing path]; Cell.mainLabel.text = Address; ...
UITableViewCell and I can not get labels from the
CustomDetailCell class. How to solve it? This decision is simple, but I believe how to solve it.
UITableViewCell * cell;
(CustomDetailCell *) storage type still
UITableViewCell
switch (indexPath.section) {case detailControllerAddressSection: {NSString * address = [auto address text]; UITableViewCell * cell; If (UI_USER_INTERFACE_IDIOM () == UIUserInterfaceIdiomPad) {if (IS_OS_7_OR_LATER) {CustomDetailCell * detailCell = (CustomDetailCell *) [tableView dequeueReusableCellWithIdentifier: @ "AddressCell" forIndexPath: indexPath]; DetailCell.mainLabel.text = Address; DetailCell.detailLabel.text = [Object data for self-distance message: self.objectData]; Cell = expansion; } Else {Universladdraessil * Universlsel = (Universladdraessil *) [Tblaviav Dekveuereuslekelvithidentifiar: @ "Universladdraessil" Forindekspat: Indekspat]; UniversalCell.backgroundView = [Self cell backgroundgroundviewview: indexpath]; UniversalCell.mainLabel.text = Address; Cell = universal cell;
Comments
Post a Comment