2013-10-22 73 views
0

我試圖弄清楚什麼是錯我相信這是簡單的串聯,我必須在這裏失去了一些東西 - 見下面的代碼:將多個TEXT和變量連接成一個字符串iOS?

NSString *combinedValues = [NSString stringWithFormat: 
          @"I am at %@" self.dancePlace.text 
          @" Airport, and I will arrive on %@" danceDateValue, 
          @" from %@" timeIn, 
          @" to %@" timeOut, 
          @" at Terminal %@" self.danceTerminal.text 
          @" Gate %@" self.danceGate.text]; 

回答

5

這是一個很好的方式

NSString *combinedValues = [NSString stringWithFormat: 
          @"I am at %@ Airport, and I will arrive on %@ from %@ to %@ at Terminal %@ Gate %@" , self.dancePlace.text, danceDateValue, timeIn, timeOut, self.danceTerminal.text, self.danceGate.text]; 
+0

丁!謝謝,我只是把它按錯誤的順序排除了....謝謝! – MagicMiles

+1

ops抱歉,錯誤的順序:) –

+0

@MagicMiles如果答案解決了你的問題可以接受嗎? thx –

相關問題