にセルを追加するUIAlertControllerボタン:今すぐにObjC - 私にこの警告制御機構を示し、私は私のtableView、BarButtonItemを持っているテーブルビュー
UIAlertController * alertController = [UIAlertController alertControllerWithTitle: @"Feed RSS: info?"
message: @""
preferredStyle:UIAlertControllerStyleAlert];
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.placeholder = @"Feed URL";
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.borderStyle = UITextBorderStyleRoundedRect;
}];
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.placeholder = @"Feed Title";
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.borderStyle = UITextBorderStyleRoundedRect;
}];
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.placeholder = @"Feed category";
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
textField.borderStyle = UITextBorderStyleRoundedRect;
}];
[alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
NSArray * textfields = alertController.textFields;
UITextField * urlfield = textfields[0];
UITextField * titlefield = textfields[1];
UITextField * categoryfield = textfields[2];
}]];
[self presentViewController:alertController animated:YES completion:nil];
、私は私がで「OK」を押したときと言いたいですアラートコントローラでは、テキストフィールドの1つのテキストがテーブルビューの最初のセルに書き込まれます。次に、他のデータを入力すると、テーブルビューの2番目のセルなどに表示されます。
あなたによれば、どうすればよいですか? この部分を修正する必要がありますか?
[alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
ありがとう!
セルの作成コードを追加してください。それから私は明確に答えを追加することができます – Subramanian
@Subramanian私はそれを作成することができなかったので、私はセルの作成のためのコードがありません。私が「OK」ボタンを押すと、セルが作成されなければなりません。空のダイナミックテーブルのみが表示されます。 – Taprolano