Если вы напишите с помощью SLRequest, как это вы не должны иметь никаких проблем (self.account
является Twitter ACAccount вы извлечены из ACAccountStore):
/**
* Post a status update via the account
*
* @param NSString* status status to post
*/
- (void)postViaAccountWithStatus:(NSString *)status
{
// Create the parameters dictionary and the URL (!use HTTPS!)
NSDictionary *parameters = @{@"status": status };
NSURL *URL = [NSURL URLWithString:kTwitterStatusesUpdateEndpoint];
// Create request
SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeTwitter
requestMethod:SLRequestMethodPOST
URL:URL
parameters:parameters];
// Since we are performing a method that requires authorization we can simply
// add the ACAccount to the SLRequest
[request setAccount:self.account];
// Perform request
[request performRequestWithHandler:^(NSData *respData, NSHTTPURLResponse *urlResp, NSError *error)
{
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:respData
options:kNilOptions
error:&error];
// Check for errors in the responseDictionary
if (urlResp.statusCode == 200)
[self updateStatusCompleteWithStatus:SHUpdateSuccessful error:error];
else
[self updateStatusCompleteWithStatus:SHUpdateFailed error:error];
}];
}