GoodHeartedOne
GoodHeartedOne

Reputation: 95

Alert View in iOS7

I'm very new to iOS and Objective C. I have the following code to create an alert view in iOS7 for an iPhone application:

if ([tracker exceededGoal]){
    [UIAlertView] *alert = [[UIAlertView alloc] initWithTitle:@"Done" message:@"You acheived your goal!" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert show];
[alert release];

}

I'm getting the following error:

Use of Undeclared identifier 'alert'

Expected identifier

What did I do wrong?

Upvotes: 0

Views: 131

Answers (1)

MillaresRoo
MillaresRoo

Reputation: 3848

Remove the brackets here: UIAlertView *alert =

Upvotes: 6

Related Questions