February 7th, 2012, 01:44 AM
Array value by using textField
I wanna to insert array value by using textField.
we can initialize array value like this.
How can I insert array value from a textFiled by user input.
Please help me.
To set the dynamic text equal to that of an array index try something like,
var btnArray:Array = new Array("btn1", "btn2", "btn3");
dynamicTextField.text = btnArray; // traces "btn1"
January 21st, 2013, 08:23 AM
Please find the solution.
YES, We can do this We need to save the text entered in text field in a string.
NSString *str=[[NSString alloc] alloc];
Now add TEXT FIELD data in ‘str’
And then [Array addObject:str];
Similar can be done again and again. This will save the text field data in Array.
July 12th, 2013, 04:48 PM
I don't think the other replies really answered your question, which (I think) is asking how to take the value from an input UITextField and insert it into an array, you'd simply use the "text" method of the textField:
// assuming we have a UITextField called "textField"
NSMutableArray *theArray = [[NSMutableArray alloc] init];
However, let me know if that does not answer your question.