1

iOS 6.0 で共有するために、プロジェクトで UIActivityViewController を使用しています。を示していEmail Optionます。しかし、ある場合No Email Accountdoes not take me to the settings pageアカウントをセットアップしますが、何もせず、「完了」ブール値フラグで NO を返します。この問題のアイデアhow to go to the settings pageまたは回避策。

ありがとう!

4

1 に答える 1

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
于 2013-01-15T21:06:01.293 に答える