ユーザーがボタンをクリックすると、テキストフィールドからのテキストを含むアラートがポップアップするアプリを作成しようとしています。しかし、試してみると、空白のアラートが表示されます。これは私のコードです:
@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;
}
私は何を間違っているのですか。すべてが適切に配置されているようです。答えは NSLog() と関係があると思います。