저는 iOS에서 새롭게 변경되었습니다.오늘 확장 프로그램에 UITableView 추가
오늘 확장 기능을 사용하고 싶습니다. 오늘 확장 기능을 만들고 uitableview를 추가하면 정상적으로 작동합니다. 하지만 행을 선택한 다음 대리자 메서드를 시도 할 때 DidSelectRowAtIndexPath이 호출되지 않습니다.
내 코드에는 3 가지 방법의 uitableview 대리자 및 데이터 소스가 있습니다.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MyIdentifier"];
}
cell.textLabel.text = [NSString stringWithFormat:@"Hello World%li",(long)indexPath.row];
return cell;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
이상 된 데이터 소스 메소드 호출을 제대로
하지만 didselect 행 방법은 행의 선택 호출하지 않습니다.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"row Selected");
}
감사합니다.
테이블보기 만 스크롤 할 수 있습니까? 더 많은 데이터가 있다면? – Maulik