cellForRowAtIndexPathではなくwillDisplayCellで設定する必要があるみたいです。
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundColor = [UIColor purpleColor];
}
cellForRowAtIndexPathではなくwillDisplayCellで設定する必要があるみたいです。
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundColor = [UIColor purpleColor];
}
iPadとiPhoneのユニバーサルアプリケーションは何故かデバイスをiPhoneにしたシュミレータににはインストール出来ません。
(やり方を知らないだけかも)
以下の方法でiPhoneシュミレーターでも動かすことできたのでメモ。
まず、iPadようにアプリをインストールしておきます。
以下はユニバーサルアプリのサンプルTopPaidをiPadシュミレーターで動かしている様子。
iPhone or iPadシュミレータのアプリは以下のディレクトリにインストールされています。
~/Library/Application Support/iPhone Simulator/
iPadの場合は
~/Library/Application Support/iPhone Simulator/3.2/Applications/
の中にアプリがインストールされているのでチェックしたいiPhone OS用のディレクトリにコピーします。
iPhone OS 3.1.3なら以下のディレクトリにコピー
~/Library/Application Support/iPhone Simulator/3.1.3/Applications/
最後にiPhoneシュミレータを起動し直せば動作します。