I downloaded the Facebook iOS SDK from github and made a custom view controller based on their sample. To post a photo, I used this code:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
image, @"picture",
nil];
[facebook requestWithGraphPath:@"me/photos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
where the facebook
object is an instance of FacebookService
provided in the Facebook SDK and image
is a UIImage
. However it's a lot more complicated than this because first you have to go to the Facebook developers site and register your app to get an App ID and Access Token, then in your app will you have to have the user autheticate your app with Facebook and handle errors, etc. You can figure it all out from their sample code in the SDK.
I haven't tried Twitter yet.