2014年2月15日土曜日

UITableViewの編集モードの「Delete」文字列の変更

UITableViewの編集モードの文字列が「Delete」なので変更したい時があります。

そんな時は「UITableViewDelegate」の「- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath」メソッドをいじります


    
//
// UITableViewDelegate
//
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return @"削除";
}

こんな感じ

自動的に幅も変わります。