ShareKit/ShareKit — Issue #133: cancel fails on iOS5
Author: ConfusedVorlon
Created: 2011-12-14 11:09:03+00:00
State: open

tap share
tap more
tap cancel (top right)
-this fails on iOS5 because parentViewController is nil for modal view controller in iOS5.

insetad, call dismodalViewController directly on the modal view and it will handle forwarding the message to the parent/presenting view controller

this should fix things:

- (void)hideCurrentViewControllerAnimated:(BOOL)animated
{
if (isDismissingView)
return;

self.isDismissingView = YES;
[currentView dismissModalViewControllerAnimated:YES];

//	if (currentView != nil)
//	{
//	// Dismiss the modal view
//	if ([currentView parentViewController] != nil)
//	{
//	self.isDismissingView = YES;
//	[[currentView parentViewController] dismissModalViewControllerAnimated:animated];
//	}
//
//	else
//	self.currentView = nil;
//	}
}

-I'm not sure what the branch that set self.currentView=nil was for - but it's gone in my fix...