2013-11-21 4 views
0

안녕 테이블 테이블 셀이 유선 응답을 보여줍니다 .. i가 ai에 각 셀의 단추 및 진행률 표시 줄이있는 coustom 테이블 테이블 뷰가 있습니다 ... 책을 다운로드 할 때 클릭 한 다음 내가 내가 두 번째 세포의 버튼 진행률 표시 줄이 2 셀 및 4 셀에 표시되어 클릭하면 진행 표시 줄이 나는 매우 혼란이와 사전테이블 셀의 진행 표시 줄

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *simpleTableIdentifier = @"Categorycell"; 

    Categorycell *cell = (Categorycell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; 
    if (cell == nil) 
    { 
     NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"Categorycell" owner:self options:nil]; 
     cell = [nib objectAtIndex:0]; 
    } 
    [tableView setSeparatorColor:[UIColor clearColor]]; 
    cell.selectionStyle=UITableViewCellSelectionStyleNone; 
cell.cell_btn.tag  = indexPath.row*10+1; 

    [cell.cell_btn addTarget:self action:@selector(btnDown:) forControlEvents:UIControlEventTouchUpInside]; 

    cell.cell_ReadBtn.tag  =indexPath.row*10+1; 
    [cell.cell_ReadBtn addTarget:self action:@selector(btnRead:) forControlEvents:UIControlEventTouchUpInside]; 

    cell.cell_Progress.tag= indexPath.row*10+1; 

    if(!bIspress) 
    { 
    cell.cell_Progress.hidden=YES; 
    } 
    NSString *comicbook_id = [arr_comic_id objectAtIndex:indexPath.row]; 
    NSString *filePath = [NSString stringWithFormat:@"book_%@.pdf",comicbook_id]; 
    NSLog(@"Book Name : %@",filePath); 
    if(![appDelegate check_Book_available:filePath]) 
    { 
     NSLog(@"Book Name Not : %@",filePath); 
    cell.cell_ReadBtn.hidden=YES; 
     cell.cell_btn.hidden= NO; 
    } 
    else 
    { 
     cell.cell_btn.hidden=YES; 
     cell.cell_ReadBtn.hidden=NO; 

    } 
    cell.tag=indexPath.row*10+1; 
    return cell; 
} 



-(void)btnDown:(UIButton*)sender 
{ 
    NSLog(@"Called when press"); 


    // sender.hidden = YES; 
    dlIndex = sender.tag/10; 
    bIspress=true; 
    NSLog(@"INDEX : %d : %d",dlIndex,[sender tag]); 
// Categorycell *cell = (Categorycell *)[self.tbl_view dequeueReusableCellWithIdentifier:@"Categorycell"]; 
// cell.cell_Progress.hidden=NO; 
// [cell.cell_Progress setProgress:0.]; 
    NSString *str_id=[arr_comic_id objectAtIndex:dlIndex]; 
    [[NSUserDefaults standardUserDefaults] setValue:str_id forKey:@"book_id"]; 
    //  dlIndex = [sender tag]/10; 
    dlCell = (Categorycell *)[[sender superview]superview]; 
    NSLog(@"INDEX progress : %d : Cell Tag : %d",dlCell.cell_Progress.tag,dlCell.tag); 

    NSIndexPath *path = [tbl_view indexPathForCell:dlCell]; 
    if(dlCell.cell_Progress.tag==dlCell.cell_btn.tag) 
    { 

     [self Apicall_background]; 

    } 

// cell_Progressview = (UIProgressView*)[dlCell.contentView viewWithTag:dlIndex*10+1]; 
// cell_Progressview.hidden = NO; 




} 

답변

0

에 감사를 도와주세요 .... 책을 다운로드 할 때까지 나타나지만 것 이것을 시도하십시오

-(void)btnDown:(UIButton*)sender 
{ 

    //your code 

    if(dlCell.cell_Progress.tag==dlCell.cell_btn.tag) 
    { 

      [self Apicall_background]; 
      CGPoint center = CGPointMake(CGRectGetMidX(dlCell.bounds), 
             CGRectGetMidY(dlCell.bounds)); 


      dlCell.cell_Progress.center = center; 

    } 
} 
+0

나는 테이블 셀의 버튼 진행 표시 줄이 – rakesh

0

나쁜 해결책 그러나 이것은 당신의 prob를 해결해야합니다. 흠.

Categorycell *cell = (Categorycell *)[tableView dequeueReusableCellWithIdentifier:nil]; 
+0

은 내가 볼 수 있어야 테이블 셀의 버튼 진행률 표시 줄을 클릭 할 때 내가 내가 당신을 시도 했 – rakesh

+0

도와주세요 필요 위치를 요구 하진 않았어 볼 수 있어야 클릭하면 내가 원하는 위치를 요구 하진 않았어 이? 진행 표시 줄이 올바른 셀에 나타나고 다른 셀에 추가로 표시되었다고하셨습니다. 그래서 이것은 빠른 수정입니다. – Retterdesdialogs

+0

[tableView dequeueReusableCellWithIdentifier : nil]; 나는 식별자에 nil을두면 테이블 뷰에 들어가는 방법을 알 수있다. – rakesh