Apple has introduced a very interesting and easy to use UIActivityViewController class in iOS 6.0 and above versions which allows us to directly post something using the already configured Social media ( Facebook and Twitter) Accounts in the Apple device(iPhone or iPad).
Below code will help you know the concept better.
NSURL * url = [NSURL URLWithString:@”http://abcd.com”];
NSString * postText = [NSString stringWithFormat:@”Hello World”];
NSArray *activityItems = @[postText, url];
UIActivityViewController *activityController =[[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:activityController animated:YES completion:nil];
[activityController release];