- (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 :(得分:0)
请进行以下更正:
static NSString *cellIdentifier = @"HistoryCell";
UITableViewCell * Cell=[tblView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
这可能是缺少的话......