UITableView - 4. TableViewCell의 타입과 Accessory

Published on: 2011. 11. 17. 18:07 by louis.dev

1. Cell을 생성할때 Type을 지정해 주고, Accessory타입을 지정하면 쉽게 타입과 악세서리를 설정할 수 있다.

[실행결과]

그리고 다른 Accessory타입과는 다르게 실행화면의 맨마지막에 있는 UITableViewCellAccessoryDetailDisclosureButton(파란원모양의 악세서리)는 delegate를 통해서 터치를 처리 할 수 있다(셀 전체를 터치하는 것이 아니라 파란원 아이콘을 탭했을 때만 실행되는 델리게이트).

해당 터치를 사용하려면 다음의 델리게이트 메소드를 작성하면 된다.
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath