-1

I already know how to change the text in label box by with a text field:

self.titleLabel.text = self.textField.text

How do I add static text to text that is being entered?

If in the textField a name is entered, how do get the label box to display a "Hi," then whatever text that was entered?

What do I have to put in front of self.textField.text after the "=" sign?

Dante
  • 1
  • 1
  • While this is off-topic for programmers, I would do it like this: `NSString *i = self.textField.text; self.titleLabel.text = [NSString stringWithFormat:@"your text: %@", i];` – tjons May 23 '14 at 00:43

1 Answers1

1

Starting from iOS 6.0, UILabel supports attributed text, initialize an NSMutableString object and then you can your label text using,

self.titleLabel.attributedText = [yourNSMSObject appendFormat:@"add your prefix text here %@",self.textField.text];

I hope this is your expected result.

Preson
  • 244
  • 2
  • 8