开发者

UIAlertView + TextField = NSString

开发者 https://www.devze.com 2023-03-09 01:21 出处:网络
If I had a correctly placed UITextFiel开发者_开发技巧d on an UIAlertView, could I assign the TextField\'s text value inside NSString using:

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)applicationDidFinishLaunchingmethod.)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消