2014-10-10 4 views
-2
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *cellIdentifier = @"HistoryCell"; 
    //UITableViewCell *cell = (TableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 
    UITableViewCell * Cell=[tblView dequeueReusableCellWithIdentifier:cellIdentifier]; 
    if (Cell == nil) 
    { 
     Cell = [[TableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 
     Cell.selectionStyle = UITableViewCellSelectionStyleBlue; 
    } 

    myString=[arr objectAtIndex:indexPath.row]; 
    NSLog(@"String %@",myString); 

    //NSString *newString = [myString stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; 

    NSURL *imageURL =[NSURL URLWithString:myString];  
    NSData *image = [[NSData alloc] initWithContentsOfURL:imageURL];  
    UIImageView *imageview=[[UIImageView alloc]initWithFrame:CGRectMake(00, 00, 80, 80)]; 

    imageview.image=[UIImage imageWithData:image]; 
    [Cell addSubview:imageview]; 
    //cell.imageView.image=[UIImage imageWithData:image]; 

    return Cell; 
} 
+0

добавить больше описания в вопросе я не получаю то, что вы хотите делайте точно. – Rushabh

+0

покажите мне ваш массив, так что я могу понять – NiravPatel

+0

Как сказал @NiravPatel, пожалуйста, покажите содержимое своего массива –

ответ

0

Пожалуйста сделайте следующее исправление:

static NSString *cellIdentifier = @"HistoryCell"; 
UITableViewCell * Cell=[tblView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath]; 

Это может быть недостающими словами ....