我想解析UITableView中的图像文本,我只能看到每行的文本,但我看不到图像。Xcode解析RSS图像的XML问题
这是我的代码;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [self.anaTablo dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
UILabel *textBaslik = (UILabel *) [cell viewWithTag:3];
UIImage *imagePic = (UIImage *) [cell viewWithTag:7];
textBaslik.text =[titleArray objectAtIndex:indexPath.row];
imagePic.images = [imageArray objectAtIndex:indexPath.row];
return cell;
}
但它没有工作和搜索我已经试过这之后;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
UILabel *textBaslik = (UILabel *) [cell viewWithTag:3];
UIImage *imagePic = (UIImage *) [cell viewWithTag:7];
textBaslik.text =[titleArray objectAtIndex:indexPath.row];
NSString *str1 = [[NSString alloc] initWithFormat:@"%@", imageArray];
NSData *bgImageData = [NSData dataWithContentsOfFile:str1];
UIImage *img1 = [UIImage imageWithData:bgImageData];
imagePic = [img1 objectAtIndex:indexPath.row];
return cell
}
难道我做错了什么?我很新的Xcode
从现在开始感谢。
我认为它不会工作再次感谢。 –
我的问题是这样的 NSString * trimmedString = [imageLink.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; –