Aravindhan
Aravindhan

Reputation: 15628

how to print a variable into a text box

hi all I have a one variable. i want to print that varible into a text box. how to do this.

Upvotes: 0

Views: 2978

Answers (4)

visakh7
visakh7

Reputation: 26400

yourTextField.text = yourVariable;

If you want to have it as a string value you can make use of stringValue

Upvotes: 1

Gypsa
Gypsa

Reputation: 11314

write

NSString * str=@"Text";

myTextField.text=str;

myTextField is the name of my textField(you can write the name of your text Field).

Upvotes: 1

Jhaliya - Praveen Sharma
Jhaliya - Praveen Sharma

Reputation: 31730

You can only display the string data in text box (UITextView),if you have other than string data it require a conversion to NSString then use the text properity of UITextView to set the display text. The below code is for your reference.

NSString* myData  = @"dISPLAY me in text box";
UITextView* myTextView = [[UITextView alloc] initWithFrame:myframe];
myTextView.text = myData;

Upvotes: 2

Vagrant
Vagrant

Reputation: 1716

You create a UILabel object, add it as a subview of your view, and call setText: on it.

Unless you are asking how to do GUI programming in general.

Upvotes: 0

Related Questions