user3099495
user3099495

Reputation: 1

Compiler error: Expected identifier or '('

Here is my code for reference. It's just one error:

{ /*** 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

}

Upvotes: 0

Views: 111

Answers (1)

Balram Tiwari
Balram Tiwari

Reputation: 5667

You got a Typo man. The problem is imagedNamed, a wrong keyword.

Kindly use [UIImage imageNamed:@"Sun 1.png"]

Upvotes: 1

Related Questions