It is an iOS 5 issue. It's because ShareKit is using a method on UIViewController
called parentViewController
and according to the Apple docs you can no longer use this in iOS 5. Instead, you must use presentingViewController
.
So to fix it in the ShareKit code, go into SHK.m, find the method with signature (void)hideCurrentViewControllerAnimated:(BOOL)animated
, and replace it with:
- (void)hideCurrentViewControllerAnimated:(BOOL)animated
{
if (isDismissingView)
return;
if (currentView != nil)
{
// Dismiss the modal view
if ([currentView parentViewController] != nil)
{
self.isDismissingView = YES;
[[currentView parentViewController] dismissModalViewControllerAnimated:animated];
} else if ([currentView presentingViewController] != nil) {
self.isDismissingView = YES;
[[currentView presentingViewController] dismissModalViewControllerAnimated:animated];
} else
self.currentView = nil;
}
}
This works for me on iOS 5.