2014-04-20 1 views
0

self.objects 배열이 읽기 전용 인 경우 PFQueryTableView에서 셀의 재정렬을 어떻게 처리합니까?PFQueryTableView에서 셀을 재정렬 하시겠습니까?

테이블을 편집 모드로 가져올 수 있으며 셀을 재정렬 할 수도 있지만 대리자 메서드에서 변경 내용을 처리하는 방법을 알지 못합니다. 난 NSMutableArray self.objects 배열에서 만들려고했지만 구문 분석 개체를 업데이트 할 알 수 없습니다. 이것은 내가 시도한 것입니다 :

- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { 

    NSMutableArray *array = [[NSMutableArray alloc]initWithArray:self.objects]; 

    PFObject *movedObject = array[fromIndexPath.row]; 

    [array removeObjectAtIndex:fromIndexPath.row]; 
    [array insertObject:movedObject atIndex:toIndexPath.row]; 


    //Then trying to reassign the updated mutable array to the self.objects array is not possible because its read only. 

} 

어떤 도움을 주시면 감사하겠습니다.

답변

0

파스 개체로 셀의 재배치를 처리하는 방법은 개별적으로 재 배열 된 개체를 업데이트하는 것이고 업데이트 된 배열을 만들지는 않는다는 것을 깨달은 후에도 많이 알았습니다.

+0

개체를 재 배열하여 공유 할 수 있습니까? PFQueryTableViewController의 하위 클래스에서이 작업을 수행하려고합니다. 감사! –

관련 문제