I'm trying to share using Twitter Framework on iOS 5 The user will select which account to use, so the app will share using the account selected.
But whem share pass to performRequestWithHandler
nothing happen an the error
return null
My code:
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);
}];
}
}
anyone can help me?
Thanks