将多个文本和变量连接成一个字符串 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];
这是

个好方法

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];

相关内容

最新更新