DCJones
DCJones

Reputation: 3461

Xcode 11.2.1 "Expected :" error in code segment when running build

I am using Xcode 11.2.1 and I am getting a parse error of Expected ':'.

The section of code is:

-(IBAction)webview:(id)sender { 

if ([Web isEqualToString:@"Not Available"]){
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"This airport does not have a Web site." message:Web delegate:self cancelButtonTitle:@"Close",nil otherButtonTitles:nil];
    [alert show];
    [alert release];
} else {
AirportWebViewController *web = [[AirportWebViewController alloc] initWithNibName:@"AirportWebViewController" bundle:nil];
    [web setTitle:@"Selected airport"];
    [web setWeb:self.Web];
    [self.navigationController pushViewController:web animated:YES];

    
}
}

Where have I missed the placement of the ":"?

Upvotes: 0

Views: 21

Answers (1)

BoygeniusDexter
BoygeniusDexter

Reputation: 2252

cancelButtonTitle:@"Close",nil otherButtonTitles contains an extra nil, it should be cancelButtonTitle:@"Close" otherButtonTitles

Upvotes: 1

Related Questions