object-c에서 호출 방식 처리와 관련하여 질문이 있습니다.어떻게 MailComposer에서 예제 코드의 Call-Method getter/setter를 사용할 수 있습니까?
메일 작성자 (http://developer.apple.com/iphone/library/samplecode/MailComposer/Introduction/Intro.html) 용 사과 샘플 코드를 다운로드했습니다.
는 사용자가 메도
-(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:@"[email protected]"];
NSArray *ccRecipients = [NSArray arrayWithObjects:@"[email protected]", @"[email protected]", nil];
NSArray *bccRecipients = [NSArray arrayWithObject:@"[email protected]"];
[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"등의 데이터를 얻을 수 있습니까?
이것도 가능합니까? 난 내가 어떤 정보를 잊어 버린 경우 당신은 내가 그들을 : 애플의 API에서 :
그러나'MFMailComposeViewController'의 기능을 확장해도'Apple API'가'... ... 당신의 응용 프로그램에 의해 수정되면 안된다 '는 경우 애플 리뷰에서 문제를 일으킬 수 있습니다. –