MagicMiles MagicMiles - 4 months ago 8x
Objective-C Question

Concatenate Multiple TEXT and Variables into one string iOS?

I'm trying to figure out what is wrong with what I believe is simple concatenation, and I must be missing something here - see code below:

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


this is a good way

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