简体   繁体   中英

Exporting data programmatically from an application

In my iPhone application,i have a registration screen contains user name, address,Phone number etc. Now i need to export this data and mail it. How can i export the data programmatically from my screen.Any help?

Thanks in Advance.

Perhaps somewhere in your app you have:

UITextField *_usernameField;

Then something similar to:

NSString *_username = [_usernameField text];
NSURL *_mailURL = [NSURL URLWithString:[NSString stringWithFormat:@"mailto:?subject=My Data&body=%@", _username]];
[[UIApplication sharedApplication] openURL:_mailURL];

will open the Mail app and create a new message with the subject "My Data" and a body that contains the text contents of the username text field. Just modify this to build the message you need to send.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM