Pregunta

Here is my code and the screenshot below:

UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Message" 
delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];

enter image description here

I'm getting a strange error on Xcode 5.

Anyone ever encountered such an error? I'm using Cocoapods and including few libs in my project. Maybe it has something to do with it?

¿Fue útil?

Solución 2

The most probable reason is an invisible invalid character somewhere in your code, probably between nil and cancelButtonTitle.

Remove the two lines entirely and write them again.

The second possibility is doing something really bad with macros, e.g defining a macro

#define cancelButtonTitle @"Cancel"

There is a reason why all macros should be written in uppercase letters:

#define CANCEL_BUTTON_TITLE @"Cancel"

And it would be even better not using macros for string constants.

Otros consejos

You don't need the comma after otherbuttonTitles: you just need otherButtonTitles:nil];

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top