cellForRowAtIndexPath: メソッドにいくつかの条件付きコードがあります。iOS6では正しく動作しているように見えましたが、iOS 7ではセルボタンに3つのドットが浮かんでいます...
また、各 if ステートメントの条件が満たされるたびに、ボタンを別のボタンに追加しているようにも見えます。
(cell == nil) { }
各テーブルセル行の条件コードのカテゴリ ID 値を確認する必要があるため、if の後に次のコードがあります。
NSNumber *catId = [[self.listingNodesArray objectAtIndex:indexPath.row] objectForKey:@"category_id"];
if ([catId isEqualToNumber:[NSNumber numberWithInt:9]] && (a == 0)) {
cell.cornerImageView.image = [UIImage imageNamed:@"cellComprareCorner.png"];
[cell.salvaBtn setBackgroundImage:[UIImage imageNamed:@"home_verde_commentsOFF.png"]
forState:UIControlStateNormal];
}
else if ([catId isEqualToNumber:[NSNumber numberWithInt:9]] && (a != 0)) {
cell.cornerImageView.image = [UIImage imageNamed:@"cellComprareCorner.png"];
[cell.salvaBtn setBackgroundImage:[UIImage imageNamed:@"home_verde_commentsON.png"]
forState:UIControlStateNormal];
}
if ([catId isEqualToNumber:[NSNumber numberWithInt:9]] && (b == 0)) {
[cell.likeBtn setBackgroundImage:[UIImage imageNamed:@"home_verde_likeOFF.png"]
forState:UIControlStateNormal];
}
else if ([catId isEqualToNumber:[NSNumber numberWithInt:9]] && (b != 0)) {
[cell.likeBtn setBackgroundImage:[UIImage imageNamed:@"home_verde_likeON.png"]
forState:UIControlStateNormal];
}
if ([catId isEqualToNumber:[NSNumber numberWithInt:10]] && (a == 0)) {
cell.cornerImageView.image = [UIImage imageNamed:@"cellBlueCorner.png"];
[cell.salvaBtn setBackgroundImage:[UIImage imageNamed:@"home_blu_commentsOFF.png"]
forState:UIControlStateNormal];
}
else if ([catId isEqualToNumber:[NSNumber numberWithInt:10]] && (a != 0)) {
cell.cornerImageView.image = [UIImage imageNamed:@"cellComprareCorner.png"];
[cell.salvaBtn setBackgroundImage:[UIImage imageNamed:@"home_blu_commentsON.png"]
forState:UIControlStateNormal];
}
if ([catId isEqualToNumber:[NSNumber numberWithInt:10]] && (b == 0)) {
[cell.likeBtn setBackgroundImage:[UIImage imageNamed:@"home_blu_likeOFF.png"]
forState:UIControlStateNormal];
}
else if ([catId isEqualToNumber:[NSNumber numberWithInt:10]] && (b != 0)) {
[cell.likeBtn setBackgroundImage:[UIImage imageNamed:@"home_blu_likeON.png"]
forState:UIControlStateNormal];
}