gpt4 book ai didi

ios - FBUserSettingsViewController 在关闭时崩溃

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:19:21 25 4
gpt4 key购买 nike

我正在尝试使用 FBUserSettingsViewController,但每次我尝试关闭它时它都会崩溃。我使用以下代码来显示它:

FBUserSettingsViewController *userSettings = [[FBUserSettingsViewController alloc] initWithNibName:nil bundle:nil];
userSettings.readPermissions = @[];
userSettings.publishPermissions = @[@"publish_actions"];
userSettings.defaultAudience = FBSessionDefaultAudienceEveryone;
userSettings.delegate = self;
[self.navigationController pushViewController:userSettings animated:YES];

它显示正常,但是当我点击“返回”时,我就崩溃了。崩溃是 EXC_BAD_ACCESS:

#0  0x34ae85de in objc_msgSend ()
#1 0x00136916 in -[FBUserSettingsViewController dealloc] at /Users/jacl/src/release/ios-sdk/src/FBUserSettingsViewController.m:86
#2 0x389e29c8 in -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] ()
#3 0x389e249e in -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] ()
#4 0x38978a82 in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] ()
#5 0x389ed8ac in -[UIViewAnimationState animationDidStop:finished:] ()
#6 0x331a22e0 in CA::Layer::run_animation_callbacks(void*) ()
#7 0x30fe45da in _dispatch_client_callout ()
#8 0x30fe7e44 in _dispatch_main_queue_callback_4CF ()
#9 0x388c31b0 in __CFRunLoopRun ()
#10 0x3883623c in CFRunLoopRunSpecific ()
#11 0x388360c8 in CFRunLoopRunInMode ()
#12 0x30a3233a in GSEventRunModal ()
#13 0x389b7288 in UIApplicationMain ()
#14 0x00003424 in main at SNIP

如果有人能告诉我我搞砸了,那就太好了,但这看起来像是 Facebook SDK 中的错误。

最佳答案

我发现了问题。 Facebook 编码他们的 dealloc 是错误的。

在 FBUserSettingsViewController 和 FBViewController 中有 dealloc,例如:

- (void)dealloc {
[super dealloc];

[_profilePicture release];
[_connectedStateLabel release];
[_me release];
[_loginLogoutButton release];
[_permissions release];
[_backgroundImageView release];
[_bundle release];
}

这是错误的,[super dealloc] 应该总是最后被调用。在他们尝试解除分配其成员之前,该对象将被拆除。我切换了顺序(最后是 dealloc),它现在可以工作了。我会就此提交错误。

关于ios - FBUserSettingsViewController 在关闭时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12827261/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com