이름과 파일 이름이 포함 된 2 개의 배열 객체가 있습니다. 그냥 같이 :UITableViewCell에서 선택된 특정 인덱스를 사용한 Safari의 링크 열기
name={"PRESENTATION FILE", "MEETING DOCUMENT", "REPORT"}
file={"item1.ppt", "item2.pdf", "item3.pdf"}
나는 이것을 첫 번째 링크 내가있는 tableview를 열고 즉시 표시 할 때 문서
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
Document * documentObject;
documentObject = [_all_documentArray objectAtIndex:indexPath.row];
cell.textLabel.text = documentObject.name;
NSString *doc_link =[[NSString alloc] initWithFormat:@"http://localhost/database/%@",documentObject.file];
NSURL *doc_url=[NSURL URLWithString:doc_link];
[[UIApplication sharedApplication] openURL:doc_url];
return cell;
}
에게 보여 내 TableViewCell에서이 코드를 사용하고 있습니다. 내가해야 할 일은 내가 선택한 목록과 동일한 색인으로 링크를 열 수 있습니까?
굉장한 친구 ^^ – Edward