Contents

Develop
2014.04.08 15:48

[ios] UITableView 특정 Row만 Update

조회 수 4783 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
여러개의 특정 row만 reload 하는 코드
// tableView에 특정 row만 reload 하겠다고 메세지 전달
[tableView beginUpdates];

// reload 하기 위한 indexPath 배열 생성
NSIndexPath *indexPath1 = [NSIndexPath indexPathForRow:1 inSection:0];
NSIndexPath *indexPath2 = [NSIndexPath indexPathForRow:3 inSection:0];

NSArray *array = [NSArray arrayWithObjects:indexPath1, indexPath2, nil];

// 특정 row를 reload
[tableView reloadRowsAtIndexPaths:array
    withRowAnimation:UITableViewRowAnimationFade];

// tableView에 reload 완료 메세지 전달
[tableView endUpdates];



한 개의 특정 row 만을 reload 하는 심플한 코드

[_tableView beginUpdates];

[_tableView reloadRowsAtIndexPaths:@[indexPath]
    withRowAnimation:UITableViewRowAnimationTop];

[_tableView endUpdates];


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
633 Develop [c] 지나가는 패킷 잡기 hooni 2003.04.23 8802
632 Develop [c++] mfc 이용한 트레이아이콘(TrayIcon) 클래스 예제 프로젝트 file hooni 2013.04.23 8797
631 Develop [c] 함수 요약 (검색해서 쓰세요..) hooni 2003.04.23 8797
630 Develop [c++] 레지스트리 등록 예제 1 file hooni 2013.04.23 8792
629 Database [mysql] 쿼리 실행시 ERROR 1366 (HY000) : incorrect string value : for column 3 hooni 2017.03.30 8790
628 Develop [c] 압축 알고리즘 소스 및 정리 file hooni 2013.04.23 8783
627 Develop [java] 채팅창 처럼.. swing.. file hooni 2013.04.23 8773
626 Develop [c] OpenGL 시어핀스키 가스킷(p.73 - 첫시간) hooni 2003.04.23 8758
625 Develop [c++] 중복실행 방지(Mutex;뮤텍스 ) 샘플 소스.. ㅋㅋ file hooni 2013.04.23 8743
624 Develop [c] OpenGL 마우스 이벤트 hooni 2003.04.23 8731
623 System/OS [linux] man 명령어 뽀개기.. hooni 2003.04.23 8725
622 Develop [c] 캘린더 양음 변환 함수 hooni 2003.04.23 8722
Board Pagination Prev 1 ... 41 42 43 44 45 46 47 48 49 50 ... 98 Next
/ 98