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