I want to add a simple limited Twitter function to my app: a user of the app enters his Twitter username and password and tweet text, and presses a button and the tweet is s
If all you want is one-way posting to Twitter, you might be better off using ShareKit, which is a little simpler than the alternatives people have mentioned so far and also supports other services, such as Facebook.
For those in 2015 looking for an answer for iOS it is the social framework
#import <Social/Social.h>
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
UIImage *img = someImage;
SLComposeViewController *tweetSheet = [SLComposeViewController
composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet setInitialText: @"my tweet text change it to your needs"];
[tweetSheet addImage:img];
[tweetSheet addURL:[NSURL URLWithString:@"http://yoursite.com"]];
[self presentViewController:tweetSheet animated:YES completion:nil];
}
You can use this engine that integrates the Twitter API with Objective C:
MGTwitterEngine
And a good tutorial here:
Tutorial
I used this engine, and its overall very easy to use.
Check bengottlieb / Twitter-OAuth-iPhone for a complete implementation of the API.
You have to implement O-Auth and can't simply manage your users' password and login yourself anymore. Twitter-Oauth-iPhone includes MGTwitterEngine by Matt Gemmell, OAuthConsumer Framework by Jon Crosby, OAuth-MyTwitter by Chris Kimpton, etc. in a relatively simple programming interface.