아이폰의 테이블뷰의 속성 중 userInteractionEnabled을 NO로 지정하게 되면 UITableViewDelegate 가 동작하지 않는다
이 경우 아래의 메소드를 구현하여 임의의 지역에 이벤트를 발생하도록 할 수 있다
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint touchPoint = [touch locationInView:i_tableView];
if ( touchPoint.y > y && touchPoint.y < y+cell_height )
{
특정동작
}
if ( touchPoint.y > y && touchPoint.y < y+cell_height )
{
특정동작
}
------------- 생략 -----------------------------
}
'iOS' 카테고리의 다른 글
아이폰 개발 유용팁 (0) | 2011.03.11 |
---|---|
테이블 뷰, 버튼에 테두리 및 둥근 모서리 처리 (0) | 2011.03.04 |
NSMutableArray 생성 방법 (0) | 2011.03.02 |
Objective C Delegate 활용 (0) | 2011.02.24 |
CFURLCreateStringByAddingPercentEscapes 메모리 관리 (0) | 2011.02.17 |