TableViewのcellを並べ替えたいです。
並べ替えはできても並べ替えが保存されず別画面から戻ると、並べ替え前の順番に戻ってしまっています。
どこがおかしいか見ていただけませんでしょうか?
tebleviewのデータはNSMutableArray *objectsに追加しています。
よろしくお願いします。
(void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
if(_objects && toIndexPath.row < [_objects count]) {
//移動対象を保持
id item = [_objects objectAtIndex:fromIndexPath.row];
// 配列からいったん消去 [_objects removeObject:item]; //保持しておいた対象を挿入 [_objects insertObject:item atIndex:toIndexPath.row]; }
}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/05/06 09:10
2015/05/07 05:24
2015/05/07 10:54
2015/05/07 11:55