0
這裏是我的參考代碼,這只是一個錯誤:。編譯錯誤:預期標識符或「(」
{ /*** Expected identifier or '(' ***/
sunanimation.animationImages = [NSArray arrayWithObjects:[UIImage imagedNamed:@"Sun 1.png"],
[UIImage imagedNamed:@"Sun 2.png"],
[UIImage imagedNamed:@"Sun 3.png"],
[UIImage imagedNamed:@"Sun 4.png"],
[UIImage imagedNamed:@"Sun 5.png"],
[UIImage imagedNamed:@"Sun 6.png"], nil];
//always need nil
[sunanimation setAnimationRepeatCount:90];
//how many times it repeats
[sunanimation setAnimationDuration:0.5];
//how many seconds each animation lasts
[sunanimation startAnimating];
//begins the animation
}
代碼開始灰色區域上方。 – user3099495
你是否宣告'sunanimation'地方? – JDS
它'imageNamed'不'問題是你發佈的代碼之前,造成imagedNamed' – Maulik