UIAlertView消息

时间:2009-12-16 09:19:50

标签: iphone nsstring uialertview

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

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

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

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

萨姆

1 个答案:

答案 0 :(得分:6)

你是否尝试过:

[NSString stringWithFormat:@"You Were Wrong, the correct structure was %@", structureName]

而不是

(@"You Were Wrong, the correct structure was %@", structureName)