开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜