所以我試圖使單元格的圖像視圖跟隨該單元格的拖放,我使用this control: BVReorderTableView來啓用重新排序單元格而無需編輯模式。 (我已經通過電子郵件向開發者瞭解了我的問題)使cell.imageviews遵循單元格的重新排序[已解決]
我的表視圖的單元格內的文本對重新排序沒有問題,但這些單元格的圖像視圖不遵循。
我願意嘗試任何其他控制你建議重新排序單元格,或自己做(但我是一個初學者)。
代碼:
- (id)saveObjectAndInsertBlankRowAtIndexPath:(NSIndexPath *)indexPath {
id object = [self.ArrayofFiveFriends objectAtIndex:indexPath.row];
[self.ArrayofFiveFriends replaceObjectAtIndex:indexPath.row withObject:@""];
return object;
}
- (void)moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
id object = [self.ArrayofFiveFriends objectAtIndex:fromIndexPath.row];
[self.ArrayofFiveFriends removeObjectAtIndex:fromIndexPath.row];
[self.ArrayofFiveFriends insertObject:object atIndex:toIndexPath.row];
}
- (void)finishReorderingWithObject:(id)object atIndexPath:(NSIndexPath *)indexPath; {
[self.ArrayofFiveFriends replaceObjectAtIndex:indexPath.row withObject:object];
}
編輯:已解決的問題,看到了自己的答案
你能給我們提供你設置單元格的代碼嗎? (可能是cellForRowAtIndexpath方法) – Kujey
當然,這裏是 http://pastebin.com/E7hMagJF –