4

Possible Duplicate:
How do I concatenate strings in Objective-C?

Hello everyone I am new to Objc, I want to concatenate strings of the Integer value with string value. Here is my code:

[runtime setText:[NSString stringWithFormat:@"%@",self.movie.runtime]];

The result will be: 120

The result that I wish to concatenate string is: 120 Minutes.

Please share me about this. Thanks

1

1 Answer 1

6

I guess, you want this

[runtime setText:[NSString stringWithFormat:@"%@ Minutes",self.movie.runtime]];

while concatenating would be:

NSString *newString = [aString stringByAppendingString:anotherString];

for immutable NSStrings

and

[aMuteableString appendString:anotherString];

for NSMutableStrings

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.