I'm trying to share using the Twitter platform on iOS 5. The user will choose which account to use, so the application will share using the selected account.
But whem bandwidth goes through to performRequestWithHandler nothing happens error return null
My code is:
for (int i = 0; i < [_accountsArray count]; i++) { //searching for a selected account if ([[[_accountsArray objectAtIndex:i] username] isEqualToString:[self getUserName]]) { actualUser = [_accountsArray objectAtIndex:i]; TWRequest *sendTweet = [[TWRequest alloc] initWithURL:[NSURL URLWithString:@"https://upload.twitter.com/1/statuses/update_with_media.json"] parameters:nil requestMethod:TWRequestMethodPOST]; [sendTweet addMultiPartData:[text dataUsingEncoding:NSUTF8StringEncoding] withName:@"status" type:@"multipart/form-data"]; ACAccountStore *account = [[ACAccountStore alloc] init]; [sendTweet setAccount:[account.accounts objectAtIndex:i]]; NSLog(@"%@",sendTweet.account); [sendTweet performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) { NSLog(@"responseData: %@\n", responseData); NSLog(@"urlResponse: %@\n", urlResponse); NSLog(@"error: %@",error); }]; } }
Can anybody help me?
thanks
source share