Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- ai 창작 소설
- 클러스터링
- 크롬
- 포켓몬고 플러스
- java
- 마스크
- 대체 역사 소설
- 시간의 심장
- IOS
- 로드밸런싱
- tomcat
- OSX
- 창문형 에어컨
- aws
- 오징어게임3
- 공기청정기
- sf
- 기아 K4
- 코로나
- 포켓몬고
- PM 2.5
- lb
- ubuntu-server
- 기아타스만
- 기아 타스만
- 포켓몬 고
- Docker
- Linux
- 초미세먼지
- 미세먼지
Archives
- Today
- Total
살며사랑하며
uitableview 안의 uibutton의 이벤트시 테이블뷰의 index 가져오기 본문
//tableview에서 해당 버튼의 이벤트 추가
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
...
[btn addTarget:self action:@selector(btnInTableView:) forControlEvents:UIControlEventTouchUpInside];
...
}
//해당 이벤트 발생시 어느 셀에서 선택이 되었는지 확인
- (IBAction)btnInTableView:(id)sender{
CGPoint buttonOriginInTableView = [sender convertPoint:CGPointZero toView:_tableView];
NSIndexPath *indexPath = [_tableView indexPathForRowAtPoint:buttonOriginInTableView];
NSLog(@"%d",indexPath.row);
}
728x90