object-c での call-methods の処理について質問があります。
メール コンポーザーのアップル サンプル コードをダウンロードしました ( http://developer.apple.com/iphone/library/samplecode/MailComposer/Introduction/Intro.html )。
ユーザーがサンプル コードの [メール作成] ボタンをタッチすると、Methode
-(void)displayComposerSheet
{
NSLog(@"MCVC displayComposerSheet");
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"Hello from California!"];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@"first@example.com"];
NSArray *ccRecipients = [NSArray arrayWithObjects:@"second@example.com", @"third@example.com", nil];
NSArray *bccRecipients = [NSArray arrayWithObject:@"fourth@example.com"];
[picker setToRecipients:toRecipients];
[picker setCcRecipients:ccRecipients];
[picker setBccRecipients:bccRecipients];
// Attach an image to the email
NSString *path = [[NSBundle mainBundle] pathForResource:@"rainy" ofType:@"png"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"rainy"];
// Fill out the email body text
NSString *emailBody = @"It is raining in sunny California!";
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
}
が読み込まれ、mailcomposerview が表示されます。
ユーザーがメールを送信するかキャンセルした後、次のメソッドが呼び出されます
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
NSLog(@"MCVC mailComposeController");
message.hidden = NO;
// Notifies users about errors associated with the interface
switch (result)
{
case MFMailComposeResultCancelled:
message.text = @"Result: canceled";
break;
case MFMailComposeResultSaved:
message.text = @"Result: saved";
break;
case MFMailComposeResultSent:
message.text = @"Result: sent";
break;
case MFMailComposeResultFailed:
message.text = @"Result: failed";
break;
default:
message.text = @"Result: not sent";
break;
}
[self dismissModalViewControllerAnimated:YES];
}
コードを実装できます。
私の質問は、「toRecipients」、「ccRecipients」、「setMessageBody」、「setSubject」などのデータをどのように取得できますか?
これは可能ですか?でゲッターを使用する方法がわかりません"- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error"-Methode
必要な情報を忘れた場合は、投稿します:)
私を助けてくれるみんなに感謝します:)