내 문제는 레이블에있는 데이터가 웹 서비스에서오고 메일 상자를 두드려서 표시해야한다는 것입니다. 간단히 말해서 mailLabel입니다. 마찬가지로 같은보기에서 나는 다른 메일 레이블이 있고 동일한 일이 발생해야하는 사용자 지정 셀을 가지고 있지만 메일 주소는 동적이고 다를 것입니다.두 개의 다른 레이블에 대한 MFMailComposeViewController
Q1) 처리 할 메일이 하나만 포함되어야합니다. 질문 2) 그렇다면 어떻게하고 다음에 어떤 절차가 필요한가요? 제가
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITapGestureRecognizer *mgmtMail1LblGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(mail1LblTappedForCC:)];
[cell.managementMemberEmail addGestureRecognizer:mgmtMail1LblGesture];
과 같은 방법이 cellForRow위한 두 번째 방법을 사용하고이 불렀다. objCCforManagement 사용자 정의 클래스의 객체이다
- (void)mail1LblTappedForCC:(id)sender
{
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@""];
NSArray *toRecipients = [NSArray arrayWithObjects:objCCforManagement.managementMemberEmail.text, nil];
[mailer setToRecipients:toRecipients];
NSString *emailBody = @"";
[mailer setMessageBody:emailBody isHTML:NO];
mailer.navigationBar.barStyle = UIBarStyleBlackOpaque;
[self presentViewController:mailer animated:YES completion:nil];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure"
message:@"Your device doesn't support the composer sheet"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
}
.
감사합니다 !!! 스택에 최고의 교사 중 하나. –