try: [self.parentViewController dismissModalViewControllerAnimated:NO];
- this is because the modal view controller is presented by the controller that presents the twitter controller and it's one that needs to dismiss the modal controller (which is the twitter controller)
UPDATE:
If you're targeting iOS 5+ then use:
[self dismissViewControllerAnimated:NO completion:nil];
//or
[self.presentingViewController dismissViewControllerAnimated:NO completion:nil];
else if you want to maintain backward compatibility use:
if([self respondsToSelector:@selector(dismissViewControllerAnimated:completion:)])
{
[self dismissViewControllerAnimated:NO completion:nil];
}
else
{
[self dismissModalViewControllerAnimated:nil];
}