2

嗨,我正在使用 SDK 3.1 上的 facebook 共享表,它可以正常工作,除非我尝试共享 2 个 url,但它会崩溃。

NSArray* urls = [NSArray arrayWithObjects:@"http://google.com", @"http://yahoo.com", nil];
BOOL displayedNativeDialog = [FBNativeDialogs presentShareDialogModallyFrom:self
                                                   initialText: @"hellooo"
                                                        images: nil
                                                          urls: urls
                                                       handler:     ^(FBNativeDialogResult result, NSError *error) {
if (error) {
    NSLog(@"handler error:%@, %@", error, [error localizedDescription]);
} else {
if (result == FBNativeDialogResultSucceeded)
{
    NSLog(@"handler success");
}
else
{
    NSLog(@"handler user cancel");
}
}
}];

结果:

-[__NSCFConstantString isMusicStoreURL]:无法识别的选择器发送到实例 0x3d23e8

*由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[__NSCFConstantString isMusicStoreURL]:无法识别的选择器已发送到实例 0x3d23e8”

4

1 回答 1

4

我相信它所采用的 NSArray 的 Urls 期望的是 NSURL,而不是 NSString。您可以使用静态 URLWithString 来获取数组的 NSURL。

于 2012-10-03T23:24:34.643 回答