【发布时间】:2012-06-11 08:13:39
【问题描述】:
在我的应用程序中,我使用 MFMailComposer 发送电子邮件。
在我的应用程序中,用户可以选择他想要发送和发送电子邮件的时间。
一切正常。但我所做的是,我使用 NSTimer 打开 MFMailComposeViewController 并以编程方式单击发送按钮。
但我不确定苹果是否会批准我的应用程序或拒绝。 有没有人在那个应用程序中使用过这种类型的功能,并且苹果已经批准或拒绝了那里的应用程序。请告知。
请帮帮我。
以下是我的代码:
-(void)showController {
MFMailComposeViewController *mailController;
//alloc, init, set properties, do whatever you normally would
[self.navigationController presentModalViewController:mailController animated:YES];
[mailController release];
[NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(sendMail:) userInfo:mailController repeats:NO];
}
-(void)sendMail:(NSTimer*)theTimer {
MFMailComposeViewController *mailController = theTimer.userInfo;
UIBarButtonItem *sendBtn = mailController.navigationBar.topItem.rightBarButtonItem;
id targ = sendBtn.target;
[targ performSelector:sendBtn.action withObject:sendBtn];
}
【问题讨论】:
-
这不是
MFMailComposeViewController的预期行为。我不建议这样做,Apple 很可能会拒绝您的应用程序使用这种自动电子邮件方法。 -
我建议您查看一些后台电子邮件发送代码,例如此处接受的答案:stackoverflow.com/questions/6284599/…
标签: iphone objective-c ios xcode ios4