Objective-C on the iPhone isn't always the easiest of languages to get you head around. Somethings that are easy in other programming languages can be a bit more obscure.
One thing that I've done a lot in VB.Net is string manipulation. It's easy, straightforward and very powerful!
The documentation around strings is thorough, but lacks enough examples of code usage in real life situations!
So, if you need to concatenate two or more strings together, use this example below!
NSString *foobar = [NSString stringWithFormat:@"%@%@", aStringObject, anotherStringObject];
Don't forget to leave a space or spaces, if you want spaces between your strings!
Happy coding!
Cheers
Graham
On June 26, 2009, In iPhone Dev Tips, By Graham F
Objective-C on the iPhone isn’t always the easiest of languages to get you head around. Somethings that are easy in other programming languages can be a bit more obscure.
One thing that I’ve done a lot in VB.Net is string manipulation. It’s easy, straightforward and very powerful!
The documentation around strings is thorough, but lacks enough examples [...]
You can also use
NSString* foobar=[aStringObject stringByAppendingString:anotherStringObject];