UIActivityViewController电子邮件共享

时间:2012-12-14 15:59:49

标签: uiactivityviewcontroller

我在我的项目中使用UIActivityViewController在iOS 6.0中共享。它显示Email Option。 但是当有No Email Account时,它does not take me to the settings page来设置我的帐户,而不做任何事情,并在“已完成”的布尔标志中返回NO。任何想法how to go to the settings page或此问题的任何解决方法。

谢谢!

1 个答案:

答案 0 :(得分:0)

这是你如何为Twitter做的,你必须做出相应的改动才能将它用于Mail:

    if (![TwitterSettings hasAccounts]) {

        //NSLog(@"UnAvailable");
        [TwitterSettings openTwitterAccounts];
    }

//
//  TwitterSettings.m
//
//

#import "TwitterSettings.h"

@implementation TwitterSettings

+ (BOOL)hasAccounts {
    // For clarity
    return [SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter];
}

+ (void)openTwitterAccounts {

    SLComposeViewController *ctrl = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
    if ([ctrl respondsToSelector:@selector(alertView:clickedButtonAtIndex:)]) {
        // Manually invoke the alert view button handler
        [(id <UIAlertViewDelegate>)ctrl alertView:nil
                             clickedButtonAtIndex:kTwitterSettingsButtonIndex];
    }
  //  [ctrl release];
}



@end