json webservice url로 채워진 표보기가 있습니다. 눈금 표시에 "UITableViewCellAccessoryCheckmark"를 사용하고 있습니다. 사용자가 여러 테이블 뷰를 선택하면 모든 선택된 행 데이터가 단일 변수에 저장되기를 원합니다. 사람들이 나를 도와 줄 수 있습니까? 아래는 코드입니다. 당신은 다중 선택을 설정 한 경우NSString에서 검사 된 행의 값을 저장하는 방법
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
if ([self.arForIPs containsObject:indexPath]) {
[cell setAccessoryType:UITableViewCellAccessoryCheckmark];
}
else {
[cell setAccessoryType:UITableViewCellAccessoryNone];
}
NSString *imagefile1 = [media1 objectAtIndex:indexPath.row];
cell.textLabel.text=[story objectAtIndex:indexPath.row];
cell.detailTextLabel.text=[descriptiondesc objectAtIndex:indexPath.row];
cell.detailTextLabel.numberOfLines=2;
//cell.detailTextLabel.backgroundColor=[UIColor clearColor];
img=[UIImage imageNamed:@"icon.png"];
cell.imageView.image=img;
NSLog(@"BOOMMMM:%@",pileup);
return cell;
}
씹는 담배의 한 조각이 유 저장하는 방법의 예를 내놔 하나의 변수에서 thecheck 행의 데이터를 시도했지만 unsucessful했습니다 – kingston
행 당 하나의 개체에 물건을 저장할 수있는 몇 가지 코드를 추가했습니다. –
@PhilippeSabourin : 나는 또한 같은 방식으로 구현했습니다. :) – Sarah