0
我使用Github上的JTRevealSidebar。我有問題,當我點擊左側邊欄(反饋)中的一個單元格,我想打開MailComposer。 MailComposer已打開,但只位於左側邊欄內。有誰能夠幫助我?MailComposer在邊欄中打開
enter code here
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
/*if (self.sidebarDelegate) {
NSObject *object = [NSString stringWithFormat:@"ViewController%d", indexPath.row];
[self.sidebarDelegate sidebarViewController:self didSelectObject:object atIndexPath:indexPath];
}*/
if(indexPath.section == 0){
if(indexPath.row == 1){ // Feedback{
MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];
mailController.mailComposeDelegate = self;
[mailController setSubject:@"Feedback für testapp"];
// Fill out the email body tex
NSString *emailBody = [NSString stringWithFormat:@"\n\n\n\nApp: %@ \n App-Version: %@ \nModel: %@ \n Version: %@",
@"TestApp",
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"],
[UIDevice currentDevice].model,
[UIDevice currentDevice].systemVersion];
[mailController setMessageBody:emailBody isHTML:NO];
[mailController setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]];
dispatch_async(dispatch_get_main_queue(), ^{
// whatever code you want to run on the main thread
[self presentModalViewController:mailController animated:YES];
});
}
}
}
我看到這個錯誤... 錯誤: 'SidebarViewController' 不可見的@interface聲明選擇 'dismissModalViewController' [self dismissModalViewController]; 我用這個解決方案測試,但我有同樣的問題: [self dismissModalViewControllerAnimated:NO]; – NoBody 2013-05-11 14:59:16
編輯了答案 – lakesh 2013-05-11 18:43:35