0

If I had a correctly placed UITextField on an UIAlertView, could I assign the TextField's text value inside NSString using:

NSString *string = myTextField.text

And what is the method for doing that when the UIAlertView's Button is pressed? (all of my code is on the-(void)applicationDidFinishLaunchingmethod.)

Matoe
  • 1

1 Answers1

0

Yes you can do that if you subclassed uiAlertview and hold a reference to your textfield. That way your string will contain the text entered in the textview.

The method for doing that would be do subclass UIAlertview to hold a uitext view. Putting all code in -(void)applicationDidFinishLaunching is not good design.

This will help you.

Praveen S
  • 10,355
  • 2
  • 43
  • 69
  • How to hold a reference to the TextField? – Matoe May 30 '11 at 13:58
  • Check the results in the link i have pasted. There are many projects on github which have subclassed uialertview to hold a uitext view. – Praveen S May 30 '11 at 13:59
  • http://stackoverflow.com/questions/376104/uitextfield-in-uialertview-on-iphone-how-to-make-it-responsive - Anyways check this question and read Stackoverflow FAQ. – Praveen S May 30 '11 at 14:08