SLComposeViewController dismisses differently for Facebook and Twitter?

zou*_*oul 18 ios slcomposeviewcontroller

I have some social sharing code that looks like this:

SLComposeViewController *composer = [SLComposeViewController composeViewControllerForServiceType:…];
[composer setInitialText:…];
[composer addURL:…];
[composer setCompletionHandler:^(SLComposeViewControllerResult result) {
    [someController dismissViewControllerAnimated:YES completion:^{
        … // 1
    }];
}];
[someController presentModalViewController:composer animated:YES];
Run Code Online (Sandbox Code Playgroud)

The problem is that the code behaves differently for Facebook and Twitter. When the user confirms the Facebook compose screen, the composer apparently dismisses itself, because the completion handler marked as 1 is never called and even when I remove the dismissViewControllerAnimated: call, everything works fine.

On the other hand, when user confirms the Twitter compose screen and I don’t dismiss it by hand, the compose screen slides out, but the app stays stuck, like some controller is still in foreground. When I add the dismissViewControllerAnimated: call, the problem disappears and the completion handler (1) is called correctly.

你有没有注意到这种行为?难道我做错了什么?这是当前的iOS 6,GitHub上的示例代码.我向苹果公司报告了这个问题(雷达#12642889),还没有反应.

zou*_*oul 2

该问题显然已在 iOS 7 中得到修复,并在 7.0 beta 版本 11A4449d 上进行了测试。