I am trying to write Twitter using IOS7 SLComposeViewController and I get the following error -
Tweet "blah blah" could not be sent because the connection to twitter failed.
I include the image and URL in my tweet - if that matters.
The code below is
SLComposeViewController *composeController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; [composeController setInitialText:@"i ran with 18 chickens under my armpits for 18 hours"]; [composeController addImage:[UIImage imageNamed:@"zoeLrg.png"]]; [composeController addURL: [NSURL URLWithString: @"http://www.nme.com"]]; [self presentViewController:composeController animated:YES completion:nil]; SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){ if (result == SLComposeViewControllerResultCancelled) { NSLog(@"delete"); } else { NSLog(@"post"); } [composeController dismissViewControllerAnimated:YES completion:Nil]; }; composeController.completionHandler =myBlock;
source share