私はtableview内で設定しているUIImageViewに問題があります:cellForRowAtIndexPath:何らかの理由で、UITableViewがビューの下半分のセルをロードすると、残りのUITableViewCellsのようにUIImageViewにイメージがロードされませんが、スクロールするとその後、それはうまくいきます..しかし、一度そうすると、トップの UItableViewCell はそのイメージをドロップします! スクロールして完全に表示されるまで。
私が行ったことは、Interface Builder で UITableViewCell を作成し、空白の UIImageView を持っていることです。次に、ViewDidLoad の UIImageView 内に配置する UIImage を設定し、次に tableview:CellForRowAtIndexPath 内に配置します: 設定してセルを返します。
コードはこちら
//.m
- (void)viewDidLoad
{
//..
storageCalcIconImage = [UIImage imageNamed:@"CALC.png"];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
SeriesSearchResultItem *myObj = [[SeriesSearchResultItem alloc] init];
if (indexPath.section == 0) {
//call obj array with all of the values from my sorting algorithum
myObj = (SeriesSearchResultItem*)[dataArrayOfObjects objectAtIndex:indexPath.row];
//.. assinging storageCalcIconImage inside if statment
firstSpaceImage.image = storageCalcIconImage;
//..
}
return cell;
}
tableView:CellForRowAtIndexPath で多くのことが起こっていますが、画像の問題に関連していないものを削除することにしました..うまくいけば、私がまだ作成していないエラーが表示されることを願っています...どんな助けも大歓迎です.