ShareKit / ShareKit

Drop in sharing features for all iPhone and iPad apps
2.19k stars 716 forks source link

"Unbalanced calls to begin/end appearance transitions for ViewController" after completing sharing #546

Closed rogmabi closed 12 years ago

rogmabi commented 12 years ago

This is the message I get in the console when I dismiss the email composer or any other sharing controller. It seems to affect both iOS 5 and iOS 6.

I am using a UITabBarController and an embedded UINavigationController. Here is some code:

SHKItem *item = [SHKItem URL:GAurl title:self.title contentType:SHKURLContentTypeWebpage];
SHKConfigurator *configurator = [[SHKConfigurator alloc] init];
[SHK setFavorites:[configurator defaultFavoriteURLSharers] forType:SHKShareTypeURL];

// customize the email subject and body
item.title = @"Worth sharing";

item.text = [NSString stringWithFormat:@"%@%@", emailBody, iTunesAppLinkRecommendation];
item.URL = [GAurl copy];

// Get the ShareKit action sheet
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];

// ShareKit detects top view controller (the one intended to present ShareKit UI) automatically,
// but sometimes it may not find one. To be safe, set it explicitly
[SHK setRootViewController:self];
// Display the action sheet
[actionSheet showFromTabBar:self.tabBarController.tabBar];
rogmabi commented 12 years ago

I just found the reason for this warning. Please refer to this answer (and comment):

http://stackoverflow.com/a/11610293/514845