How to concatenate strings (i.e. print several at a time)

This is really simple in PHP, however it’s not obvious in Objective-C because you’re not printing the strings directly. Rather you print two objects that point to each string. There is a method though which has the same effect: stringByAppendingString. Here’s how you use it:

It gets a bit more complex when you want to add three or more together; each stringByAppendingString expression needs to be in [brackets] before you add another one, like so:

Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at and

One thought on “How to concatenate strings (i.e. print several at a time)

  1. If you just want to print several strings that don’t necessarily have to become a single new string you can also choose to print them like this:

    The %@ will be replaced with nameString. You can add as many as you like.

Add your voice!