在执行这段代码时
FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
dialog.fromViewController = viewController;
dialog.shareContent = content;
dialog.mode = FBSDKShareDialogModeFeedWeb;
dialog.delegate = self;
[dialog show];应用程序在对话框显示时崩溃;使用此堆栈跟踪:
0 CoreFoundation 0x2b9effa7 <redacted> + 150
1 libobjc.A.dylib 0x3a0a0c8b objc_exception_throw + 38
2 CoreFoundation 0x2b9f53a9 <redacted> + 0
3 CoreFoundation 0x2b9f32c7 <redacted> + 714
4 CoreFoundation 0x2b922ba8 _CF_forwarding_prep_0 + 24
5 uCiC 0x003cf1ef +[FBSDKInternalUtility isBrowserURL:] + 22
6 uCiC 0x0044c9f5 +[FBSDKShareUtility _validateNetworkURL:name:error:] + 64
7 uCiC 0x0044b17d +[FBSDKShareUtility validateShareLinkContent:error:] + 176
8 uCiC 0x0044ad71 +[FBSDKShareUtility validateShareContent:error:] + 284
9 uCiC 0x004433ad -[FBSDKShareDialog validateWithError:] + 84
10 uCiC 0x004431c5 -[FBSDKShareDialog show] + 36
11 uCiC 0x002028c7 -[ICSocialSharer fbSharingInAppWebViewContent:inViewController:] + 306
12 uCiC 0x002031f5 -[ICSocialSharer fbSharingForPostModel:inViewController:] + 2316
13 uCiC 0x00203549 -[ICSocialSharer postMessageForModel:socialNetwork:inViewController:] + 568
14 uCiC 0x000ea2e5 -[PostFotoViewController postSocial:] + 1528
15 UIKit 0x2f0a2c4b <redacted> + 70
16 UIKit 0x2f0a2bf1 <redacted> + 44
17 UIKit 0x2f08d7e3 <redacted> + 582
18 UIKit 0x2f0a265d <redacted> + 588
19 UIKit 0x2f0a2337 <redacted> + 522
20 UIKit 0x2f09bc11 <redacted> + 544
21 UIKit 0x2f071e05 <redacted> + 196
22 UIKit 0x2f2e86fb <redacted> + 14414
23 UIKit 0x2f070819 <redacted> + 1352
24 CoreFoundation 0x2b9b5d8f <redacted> + 14
25 CoreFoundation 0x2b9b519f <redacted> + 218
26 CoreFoundation 0x2b9b3805 <redacted> + 772
27 CoreFoundation 0x2b8fff31 CFRunLoopRunSpecific + 476
28 CoreFoundation 0x2b8ffd43 CFRunLoopRunInMode + 106
29 GraphicsServices 0x333da201 GSEventRunModal + 136
30 UIKit 0x2f0d1879 UIApplicationMain + 1440
31 uCiC 0x0010d07d main + 108
32 libdyld.dylib 0x3a652aaf <redacted> + 2原因是:“-_NSCFString方案:发送到实例0x187a8030的未识别的选择器”。
这是在我们使用iOS9构建之后发生的。
现在,plist包含了FaceBookSDK 4.6的正确方案,也允许使用AppTranspotPolicy。
你们知道怎么解决这个问题吗?
谢谢你,D.
发布于 2015-09-24 07:38:06
显然,Facebook不检查内容urls是否实际上是urls,它们调用NSURL方案,即使对象是NSString。
因此,内容映像url是这样编写的,编译器没有发出任何警告或出现任何问题:
content.imageURL = [sharedData valueForKey:@"link"]; //which is an NSString在做了这样的NSURL之后
content.imageURL = [NSURL URLWithString:[sharedData valueForKey:@"link"]];一切似乎都正常。
很糟糕,因为编译器没有抱怨,但是应用程序在运行时崩溃。我还会在Facebook上注册一个bug。
PS:我在这里写了这个给任何会碰到这个的人。
https://stackoverflow.com/questions/32743074
复制相似问题