简体   繁体   English

ShareKit 2.0 Facebook分享网址

[英]ShareKit 2.0 facebook share URL

I have the following code for sharing with facebook using ShareKit: 我有以下代码用于使用ShareKit与Facebook共享:

-(void)buttonAction:(id)sender
{
[SHK setRootViewController:self];
SHKItem *facebookItem = [[SHKItem alloc] init];

    facebookItem = [SHKItem URL:[NSURL URLWithString:@"www.google.com"] title:@"Some test title"];

    facebookItem.facebookURLSharePictureURI = @"www.myTestPicture.com";

   facebookItem.facebookURLShareDescription = @"Custom share description";


    [SHKFacebook shareItem:facebookItem];
}

Everything works fine except for one scenario. 除一种情况外,其他一切都正常。 My application has a log out button. 我的应用程序有一个注销按钮。 Upon hitting this button, all the data save in NSUserDefaults gets erased. 按下此按钮后,保存在NSUserDefaults中的所有数据将被删除。 So, I log in and then make a post to facebook. 因此,我登录后在Facebook上发帖。 Then, I log out (erase all the data) and afterwards log back in with facebook. 然后,我注销(擦除所有数据),然后使用Facebook重新登录。 Everything works so far. 到目前为止,一切正常。 However if I try to make another post to facebook at this point, my application crashes with no error showing up in the console. 但是,如果我此时尝试在Facebook上发表另一篇文章,我的应用程序将崩溃,并且不会在控制台中显示任何错误。 If I restart the application and try to make the same post again, it works. 如果我重新启动该应用程序并尝试再次发出相同的帖子,则它可以工作。 It only crashed after loging out, back in (with facebook) and then trying to make the post. 它仅在注销后崩溃,然后重新登录(使用Facebook),然后尝试发布帖子。 Any clues? 有什么线索吗? Thanks. 谢谢。

EDIT: Seems like it is crashing in FBDialog at line 341: 编辑:好像它在FBDialog中的第341行崩溃:

_webView = [[UIWebView alloc] initWithFrame:CGRectMake(kPadding, kPadding, 480, 480)];

好的,所以在这里进行了一些挖掘之后,根据为什么在创建UIWebView之后清除NSUserDefaults会导致EXC_CRASH的原因 ,这似乎是Apple在iOS 5.1中的错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM