I’m using a UITextfield to input information. I have several UITextfields that need to equal the input UITextfield. I’m using this bit of code:
tex34.text = tex33.text;
How do I expand the code to handle multiple textfields?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s no ‘broadcast’ idea that will allow you to set them all with one statement. You’ll just have to have as many assignments as you have text fields. If you have a billion of them, you could write some Perl to output the code.
e.g.
If you’re in a tight loop, you can save some property read invocations using a temporary string:
If you really have a lot of them (unlikely), you can build the text field variable names as NSStrings and use key-value-coding to update their text property:
This approach will require that you have each
texXXset up as a property…