StaticCellsのローカライズ
storyboardでStaticCellsのテーブル作ってたんだけど、ローカライズがめんどい。
とりあえず以下のようなコードで対応しているけど、もっとスマートな方法は無いかなぁ…。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSArray *titles = @[NSLocalizedString(@"TitleIndex_One", nil), NSLocalzedString(@"TitleIndex_Two", nil)]; UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; cell.textLabel.text = titles[indexPath.row]; return cell; }
というかStaticCells使わずにDynamicPrototypesにしておけば良かった。