0
にcnstantされていないインタフェースNSMutableArrayのの大きさを必要と私はエラーを取得していますスニペットです:添字以下は非脆弱なABI
-(IBAction)rateButtonClick:(id)sender{
NSMutableArray *starImage = [[NSMutableArray alloc]initWithObjects:starImage1, starImage2, starImage3, starImage4, starImage5, nil];
NSArray *halfRateButton = [[NSArray alloc]initWithObjects:halfRateButton1, halfRateButton2, halfRateButton3, halfRateButton4, halfRateButton5, nil];
int buttonClicked = (((UIButton *)sender).tag);
int i;
for (i = 0; i < buttonClicked; i++) {
**starImage[buttonClicked].image = [UIImage imageNamed:@"rate.png"];**
}
if (lastButtonClicked != buttonClicked) {
**starImage[buttonClicked].image = [UIImage imageNamed:@"star-half-full.png"];**
}else
**starImage[buttonClicked].image = [UIImage imageNamed:@"rate.png"];**
lastButtonClicked = buttonClicked;
for (i = 0; i <= buttonClicked; i++) {
**halfRateButton[i].hidden = YES;**
}
}
エラーがマークされた行に入っています。
**[starImage objectAtIndex:i].image = [UIImage imageNamed:@"rate.png"];**
と変更されていません。私はエラーを取得する:
ここimage property not found on object of type (id).
、starImage5にsatrImage1がUIImageViews
あります。 halfRateButton1〜halfRateButton5はボタンです。
を試してみて、これは非常によく、それはあなたのために働いたことを聞いて解答&喜んを受け入れるための –
おかげで働いた....ありがとうございました:) –