views:

79

answers:

0

Im researching the best plan of attack for creating a form that gathers information from the user and sends this dates to a server. I thought I would run my thinking past you all and get some feed back.

To create the actual form I plan on using a table view and navigation controller much like the from used to create a new contact in the "contacts" app.

The bit that need some guidance on is the management of the forms data:

1)Firstly I guess I should create a model class with a property for each form filed? Alternatively I could have one property a NSDictionary and store all the forms data as key value pairs?

2)I then need to get the form data into an XML file with a custom layout. Ordinarily I would write the dictionary to a file using:

- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag

But this I guess will give me the date basically in a plist format and not the structure of the XML file expected by the server?

Once I have the form data in the XML format expected by the server I need to send it. But before I do that I need to handle the certificate from the "https://" connection. To do this I plan on using the Certificate,Key and Trust C API.

Though there may be an easier way to send data over SSL?

3) I then need to send the dat to the server using NSurl.

Is this the correct approach or is there a better way?