0
私はiPadアプリケーションを持っていて、私はbool型の5つの属性を持つオブジェクトを持っています。私はUIImageViewを持っています。どこにこれらの属性が当てはまるかに応じて画像を配置する必要があります。これはうまく動作する私のソースコードです:Objective-C - ブール値の属性 - >画像をマップ
if (myObject.attribute1) {
myCell.imageView.image = [UIImage imageNamed:@"imageForAttribute1.png"];
} else if (myObject.attribute2) {
myCell.imageView.image = [UIImage imageNamed:@"imageForAttribute2.png"];
} else if (myObject.attribute3) {
myCell.imageView.image = [UIImage imageNamed:@"imageForAttribute3.png"];
} else if (myObject.attribute4) {
myCell.imageView.image = [UIImage imageNamed:@"imageForAttribute4.png"];
} else if (myObject.attribute5) {
myCell.imageView.image = [UIImage imageNamed:@"imageForAttribute5.png"];
}
私のために、それは良くないようです。この "問題"を解決するためのより良い方法はありませんか?
最高のお付き合い