I'm pretty new to Objective C, but I know quite a bit about Java and a bit about C++. What I'm trying to do is combine two strings and put a "to" in the middle.
In my Java program, I have two Strings, "startdate" and "enddate". I am combining them into a third String, "str" using the following line of code:
str = startdate + "to" + enddate;
I'm trying to do the exact thing in Objective-C, but I am having quite a bit of trouble with the NSString class. I have used the same variable names and wrote the following line of code:
str = @"%@ to %@", startdate, enddate;
I have a feeling that is totally wrong. I also wrote the following line of code, thinking it may be better:
str = *startdate + @" to " + *enddate;
What should I be doing?
Thanks for the help!
In my Java program, I have two Strings, "startdate" and "enddate". I am combining them into a third String, "str" using the following line of code:
str = startdate + "to" + enddate;
I'm trying to do the exact thing in Objective-C, but I am having quite a bit of trouble with the NSString class. I have used the same variable names and wrote the following line of code:
str = @"%@ to %@", startdate, enddate;
I have a feeling that is totally wrong. I also wrote the following line of code, thinking it may be better:
str = *startdate + @" to " + *enddate;
What should I be doing?
Thanks for the help!