snr*_*brn 1 iphone objective-c alerts nsstring
我正在尝试创建一个用户单击按钮的应用程序,并弹出一个警告,其中包含文本字段中的文本.但每当我尝试,我只是得到一个空白的警报.这是我的代码:
@synthesize label;
@synthesize textBox1;
@synthesize text;
- (IBAction)buttonClick {
UIAlertView *someText = [[UIAlertView alloc] initWithTitle: @"Text from textbox1" message: text delegate: self cancelButtonTitle: @"OK" otherButtonTitles: nil];
[someText show];
[someText release];
text = textBox1.text;
label.text = text;
}
Run Code Online (Sandbox Code Playgroud)
我做错了什么似乎一切都到位应有的样子.我认为答案可能与NSLog()有关.
| 归档时间: |
|
| 查看次数: |
104 次 |
| 最近记录: |