メソッド内でこの問題に対処できますtableView:cellForRowAtIndexPath:
。
Apple のガイドが示唆する方法で静的セルを実装したと仮定すると、オブジェクトを介して提供されるセルを返すステートメントtableView:cellForRowAtIndexPath:
のシーケンスのようになります。if-then-else
IBOutlet
if (indexPath.row == 0) {
return cell1;
} else if (indexPath.row == 1) {
return cell2;
} // .. and so on
このコードを次のように変更します。
UITableViewCell *res = nil;
if (indexPath.row == 0) {
res = cell1;
} else if (indexPath.row == 1) {
res = cell2;
} // .. and so on
// Call your custom code that makes the label visible
if (allTextPropertiesHaveBeenLoaded) {
[res setMyLabelVisible];
}
return res;
すべてのテキスト プロパティが設定されたら、 を呼び出しreloadData
て、すべてのセルを強制的に通過させtableView:cellForRowAtIndexPath:
、再構成します。