Q:

SLCOmposeviewcontroller twitter sharing alert issue

I have been using this code for twitter posting .
SLComposeViewController *fbController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
    SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result){

        [fbController dismissViewControllerAnimated:YES completion:nil];

        switch(result){
            case SLComposeViewControllerResultCancelled:
            default:
            {
                NSLog(@"Cancelled.....");

            }
                break;
            case SLComposeViewControllerResultDone:
            {
                NSLog(@"Posted....");
                UIAlertView *alertView = [[UIAlertView alloc]
                                          initWithTitle:@"Success"
                                          message:@"Posted Successfully"
                                          delegate:self
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles:nil];
                [alertView show];

            }
                break;
        }};

    [fbController addImage:[UIImage imageNamed:@"1.jpg"]];
    [fbController setInitialText:@"Check out this article."];
    //[fbController addURL:[NSURL URLWithString:@"http://soulwithmobiletechnology.blogspot.com/"]];
    [fbController setCompletionHandler:completionHandler];
    [self presentViewController:fbController animated:YES completion:nil];
}

If the user doesn't setup the twitter account it is displaying the alert which is having the setting and cancel buttons . But it is not displaying the alert in the Device? Could any one help me please . Thanks in advance .

A:

The same thing happens with Facebook sharing. Remove the test:
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])

If the user's Twitter account isn't already set up in iOS 6, the above test will evaluate to false and none of the sharing code will execute.
Instead, if you skip the check and try to present the SLComposeViewController anyway, iOS will prompt the user to set up their Twitter account.

