iOS Help Storing Input into a Variable

keeweepoo

macrumors newbie
Original poster
Dec 26, 2007
9
0
Hi, i would to have a few text input boxes storing the user input into a variable. as of now i am able to declare the UITextFields, and when the user selects the submit button it passes the user input as follows

Code:
-(IBAction) submitYourName;
{
	lblUserTypedName.text = [NSString stringWithFormat: @"hello your name is %@ %@", txtUserName.text, txtUserName2.text];
}
So that the two text fields are now shown. I am sure this is a round about way of passing input data, but I would really like to be able to store the input into a variable for each. Advice on how I can start learning this?
 

drf1229

macrumors regular
Jun 22, 2009
237
0
Hi, i would to have a few text input boxes storing the user input into a variable. as of now i am able to declare the UITextFields, and when the user selects the submit button it passes the user input as follows

Code:
-(IBAction) submitYourName;
{
	lblUserTypedName.text = [NSString stringWithFormat: @"hello your name is %@ %@", txtUserName.text, txtUserName2.text];
}
So that the two text fields are now shown. I am sure this is a round about way of passing input data, but I would really like to be able to store the input into a variable for each. Advice on how I can start learning this?
Please explain your thinking a little more. What exactly are you trying to do? Do you want to take the text from your txtUserName field into a variable you can use multiple times. If so, you might want to to store it into an NSString, as you seem to know how to use.
 
Comment

keeweepoo

macrumors newbie
Original poster
Dec 26, 2007
9
0
Thanks for the reply.

I am essentially wanting to have five different text inputs, and each input I would like to store into a variable. So, after the user has typed in data for each of the five text inputs, I then take each of those variables and do some math with them. However, I am finding it hard to find variable tutorials so seeking some help.
 
Comment

drf1229

macrumors regular
Jun 22, 2009
237
0
I see... Well it looks like you need to learn Objective C for the basics. Although its not exact it will get you familiar with most of the foundations you'll need to know.
 
Comment

keeweepoo

macrumors newbie
Original poster
Dec 26, 2007
9
0
That url you sent shows me how to declare and work with variables which I've learned using PHP and regular C. I'm trying to find out how to store and use these variables throughout my .h, .m, and interface builder. Any help would be greatly appreciated.

Also, that tutorial is for C and not ObjC.
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.