0
我有一個非常基本的問題與NSString stringWithFormat。我想要輸入用戶輸入的名稱並顯示在alertView:Welcome用戶名中。無法找出與stringWithFormat的錯誤
NSString *welcomeMessage = [NSString stringWithFormat:(@"Welcome %@", passedData)];
UIAlertView *alert = [[UIAlertView alloc] //show alert box with option to play or exit
initWithTitle: welcomeMessage
message:@"Once you press \"Play\" the timer will start. Good luck!"
delegate:self
cancelButtonTitle:@"I want out!"
otherButtonTitles:@"Play",nil];
[alert show];
passedData是已輸入的用戶名。我目前的方式 - 只有用戶名顯示在警告框的標題中,而不是「歡迎」部分。我知道我在這裏錯過了一些真正的基礎知識,但會感謝一些幫助。
它是那樣簡單,謝謝。 – garethdn 2012-04-02 13:48:47
@garethdn不用客氣;) – Novarg 2012-04-02 13:51:10