添付ファイルとして電子メールで収集したデータを送信するアプリがあります。私は作成し、私のdocsフォルダの 'leads.xml'と呼ばれるファイルにデータを保存するために、次のコードを使用します。保存したテキストファイルを電子メールの添付ファイルとして送信するには
NSArray *sysPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *sysFilePath = [sysPath objectAtIndex:0];
[picker addAttachmentData:sysFilePath mimeType:@"text/xml" fileName:@"leads.xml"];
.
.
.
[emailBody writeToFile:filePath atomically:YES];
私は、このコードを使用して添付ファイルとして保存されたファイルを送信しよう -
NSArray *sysPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docDirectory = [sysPaths objectAtIndex:0];
NSString *filePath = [NSString stringWithFormat:@"%@/leads.xml", docDirectory];
私はエラーを取得し、それを実行すると、私が間違って何をやっていますか?
での作業...? – DShah