티스토리 뷰
didSelectRowAtIndexPath는 TableView를 사용할 경우 지정된 행이 선택되었는지 알려줍니다.
tableView:didSelectRowAtIndexPath:
Tells the delegate that the specified row is now selected.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
Parameters
tableView
A table-view object informing the delegate about the new row selection.
indexPath
An index path locating the new selected row in tableView.
Discussion
The delegate handles selections in this method. One of the things it can do is exclusively assign the check-mark image (UITableViewCellAccessoryCheckmark) to one row in a section (radio-list style). This method isn’t called when the editing property of the table is set to YES (that is, the table view is in editing mode). See "Managing Selections" in Table View Programming Guide for iOS for further information (and code examples) related to this method.
Availability
- Available in iOS 2.0 and later.
See Also
- – tableView:willSelectRowAtIndexPath:
- – tableView:didDeselectRowAtIndexPath:
Declared In
UITableView.h
[사용 예]
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UINavigationController *mainNavCon = self.navigationController;
if(indexPath.row == 0) //indexPath가 0 일때 = 첫번째 행이 선택되었을때
{
FirstXib *firstView = [[FirstXib alloc]initWithNibName:@"FirstXib" bundle:nil];
[mainNavCon pushViewController:firstView animated:YES];
}
else {
SecondXib *secondView = [[SecondXib alloc]initWithNibName:@"SecondXib" bundle:nil];
[mainNavCon pushViewController:secondView animated:YES];
}
}
'헉!! > iOS' 카테고리의 다른 글
[iOS 개발] UIPickerViewDelegate Protocol Reference (0) | 2011.09.14 |
---|---|
[iOS 개발] pickerView:numberOfRowsInComponent (0) | 2011.09.14 |
[iOS 개발] IBAction을 사용하여 View 전환하기 (4) | 2011.07.22 |
[iOS 개발] 테이블 생성 및 글자 넣어 출력해보기 (0) | 2011.07.21 |
[iOS 개발] Xcode의 기본적인 화면구성 (2) | 2011.07.21 |
- Total
- Today
- Yesterday
- tomcat
- 아이폰 개발
- MySQL
- 오블완
- oracle
- 오브젝트 C
- JSP
- Spring Framework
- 아이폰 어플리케이션
- 아이폰
- IT
- Object C
- iBATIS
- zero
- iPhone
- iOS 개발
- Objective-C
- JavaScript
- Java
- 제이쿼리
- Spring
- MAC OSX 10.7
- jQuery
- 자바
- Programming
- Objective C
- 오브젝티브 C
- 티스토리챌린지
- SQL
- 자바스크립트
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |