user1188275 user1188275 - 1 year ago 70
iOS Question

How to display an Integer Value in UITextField?

One of My First View Controller's method returns an integer value which I want to display it in second view controllers's text field. how to set the value.because

takes only String as input.

Answer Source

You should save the integer in a NSString using the method:

  • (id)stringWithFormat:(NSString *)format

for example

int number = 0;

NSString *myString;

myString = [NSString stringWithFormat:@"%d", number];

Now number is saved in a NSString and you can use it on the UITextField property

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download