UIAlertView + TextField = NSString
If I had a correctly placed UITextFiel开发者_开发技巧d 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)applicationDidFinishLaunching
method.)
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.
精彩评论