私は3つのUITextField
と1つのUIButton
を持つプロジェクトを作成しています。今テキストフィールドで私はユーザーが入力を与える機能を持っています。私は、テキストフィールドの値をXMLファイルに保存する必要があるボタンの押下でtarget-actionを定義します。 xmlファイルを作成し、すべてのデータをxmlファイルに一意のIDで保存するにはどうすればよいですか?テキストフィールドのデータを使ってXMLファイルを書き込む方法
-(IBAction)Submit:(id)sender{
if([txtPhone.text length] == 0 || [txtPhone.text isEqualToString:@""] && [txtName.text length] == 0 || [txtName.text isEqualToString:@""] && [txtEmail.text length] == 0 || [txtEmail.text isEqualToString:@""])
{
UIAlertView *info = [[UIAlertView alloc] initWithTitle:@"Info" message: @"Please fill the form." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[info show];
[info release];
}
else {
sixthView=[[SixthView alloc] initWithNibName:@"SixthView" bundle:nil];
[self.navigationController pushViewController:self.sixthView animated:YES];
self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:nil action:nil] autorelease];
}
}
私はボタンの行動のコードを定義しています。ここで私はXMLファイルにデータを保存したい。この質問は誰にも似ていません。 – ram