UIAlertView消息

Sam*_*man 0 iphone nsstring uialertview

尝试在UIAlertView显示的消息中包含实例变量.

lostAlert = [[UIAlertView alloc] initWithTitle:@"Sorry" message:(@"You Were Wrong, the correct structure was %@", structureName)  delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
Run Code Online (Sandbox Code Playgroud)

但是,显示警报时,不会显示任何消息.

任何想法和帮助将不胜感激:)

山姆

Vin*_*nga 6

你试过吗:

[NSString stringWithFormat:@"You Were Wrong, the correct structure was %@", structureName]
Run Code Online (Sandbox Code Playgroud)

代替

(@"You Were Wrong, the correct structure was %@", structureName)
Run Code Online (Sandbox Code Playgroud)