【问题标题】:How to solve share-kit issue for posting a text to facebook through iPhone simulator 5.1如何解决通过 iPhone 模拟器 5.1 将文本发布到 Facebook 的共享工具包问题
【发布时间】:2012-12-13 11:00:38
【问题描述】:

我在通过共享工具包向facebook 发布文本时遇到问题,当我选择iphone 6.0 模拟器时,它在facebook 和推特上成功发布,但是当我选择iphone simulator 5.1 时,它要求我在单击时登录登录它转到facebook 页面,当我按下确定按钮时,右上角有一个确定按钮,尽管我已经登录,但它再次带我返回登录页面我不知道为什么会发生此错误。 当我选择 iphone simulator 5.0 它给了我例外

2012-12-28 10:35:16.084 SendQuote[431:c07] -[CFXPreferencesSearchListSource tryLock]: unrecognized selector sent to instance 0x80b42f0
2012-12-28 10:35:16.103 SendQuote[431:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CFXPreferencesSearchListSource tryLock]: unrecognized selector sent to instance 0x80b42f0'
*** First throw call stack:
(0x1b69052 0x1426d0a 0x1b6aced 0x1acff00 0x1acfce2 0x79c1770 0xf4aa39 0x1b34885 0x1b347a8 0xe8f1aa 0x59c169 0x5a48bd 0x5a51f8 0x598aa9 0x234bfa9 0x1b3d1c5 0x1aa2022 0x1aa090a 0x1a9fdb4 0x1a9fccb 0x234a879 0x234a93e 0x596a9b 0x2b3a 0x2a45 0x1)
terminate called throwing an exception(lldb) 

这是我的 Facebook 分享代码

case 1: // facebook
        {
            if(NSClassFromString(@"SLComposeViewController"))
            {
                SLComposeViewController *fbController = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
                SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result){

                    [fbController dismissViewControllerAnimated:YES completion:nil];

                    switch(result){
                        case SLComposeViewControllerResultCancelled:
                        default:
                        {
                            NSLog(@"Cancelled.....");

                        }
                            break;
                        case SLComposeViewControllerResultDone:
                        {
                            ALERT_VIEW(@"Successfully posted to facebook.");
                        }
                            break;
                    }};

                [fbController setInitialText:quotesss];
                [fbController setCompletionHandler:completionHandler];
                [self presentViewController:fbController animated:YES completion:nil];
            }
            else
            {
                DEFacebookComposeViewControllerCompletionHandler completionHandler = ^(DEFacebookComposeViewControllerResult result) {
                    switch (result) {
                        case DEFacebookComposeViewControllerResultCancelled:
                            NSLog(@"Facebook Result: Cancelled");
                            break;
                        case DEFacebookComposeViewControllerResultDone:
                            ALERT_VIEW(@"Successfully posted to facebook.");
                            break;
                    }

                    [self dismissViewControllerAnimated:YES completion:nil];
                };
                DEFacebookComposeViewController *facebookViewComposer = [[DEFacebookComposeViewController alloc] init];
                self.modalPresentationStyle = UIModalPresentationCurrentContext;

                [facebookViewComposer setInitialText:quotesss];

                facebookViewComposer.completionHandler = completionHandler;
                [self presentViewController:facebookViewComposer animated:YES completion:nil];
                [facebookViewComposer release];
            }
            break;
        }

【问题讨论】:

  • 分享一些在facebook上发帖相关的代码...
  • 在iOS 6中,facebook预装在iphone中,但在iOS 5中没有。有什么相关的吗?
  • 谁能回答我???????

标签: iphone ios facebook ios-simulator sharekit


【解决方案1】:

在你的 SDK 中去 facebook.m 类找到这个方法:

- (void)authorize:(NSArray *)permissions
         delegate:(id<FBSessionDelegate>)delegate

然后替换你的最后一行是:[self authorizeWithFBAppAuth:YES safariAuth:YES];

使用这一行:[self authorizeWithFBAppAuth:YES safariAuth:NO;然后检查。

【讨论】:

  • 前一天我也遇到了最新共享工具包的问题,​​然后我更改了共享工具包并下载了旧版本,然后我的问题就解决了。你也试试这个...
  • 你能告诉我如何在 ios 模拟器 5 中删除异常吗?这是否也是由于 sharekit 而发生的?
  • 可能是由于共享工具包而发生的,我正在更改共享工具包,然后我的问题得到解决...
  • 我最近再次向您发送了一封邮件,之前我发送了错误的共享工具包。对不起,现在我给你发送一次检查它......再次抱歉......
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-09-24
  • 2012-09-25
  • 2019-09-15
  • 1970-01-01
  • 2013-07-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多