Helpful Information
 
 
Category: iPhone SDK Development
Array value by using textField

I wanna to insert array value by using textField.

we can initialize array value like this.

[Array addObject:NslocalizedString(@"Hai",nil)];

How can I insert array value from a textFiled by user input.

Please help me.

Thank You.

To set the dynamic text equal to that of an array index try something like,
PHP Code:
var btnArray:Array = new Array("btn1", "btn2", "btn3");
dynamicTextField.text = btnArray[0]; // traces "btn1"

Hi Dear

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.

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];
[theArray addObject:textField.text];

However, let me know if that does not answer your question.










privacy (GDPR)