gpt4 book ai didi

swift - FBRequestConnection.startWithGraphPath swift 崩溃

转载 作者:行者123 更新时间:2023-11-28 05:34:41 24 4
gpt4 key购买 nike

我正在使用 Facebook SDK 快速获取用户个人资料数据,但调用 FBRequestConnection.startWithGraphPath:completionHandler: 会 swift 崩溃。

我会留下我认为是日志的相关部分

1.  While type-checking 'profile' at /Users/fratelli/Documents/Projects/Wink/Wink/OAuthFacebookSession.swift:118:14
2. While type-checking expression at [/Users/fratelli/Documents/Projects/Wink/Wink/OAuthFacebookSession.swift:139:9 - line:142:9] RangeText="FBRequestConnection.startWithGraphPath(
self.readPermissions(),
completionHandler: completionHandler
)"
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
Command /Applications/Xcode6-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254

我已经填写了错误报告。现在,除了使用 Objective-c 之外,我看不到任何其他解决方法。我想知道是否有任何其他 FB SDK 方法我可以尝试达到同样的效果。

代码如下:

    var completionHandler = {
connection, result, error in
} as FBSessionStateHandler;

// Request the profile info
FBRequestConnection.startWithGraphPath(
"me?fields=birthday,gender,first_name,last_name,name_format,picture",
completionHandler: completionHandler
);

最佳答案

试试这个:

var completionHandler = {
connection, result, error in
} as FBRequestHandler;

// Request the profile info
FBRequestConnection.startWithGraphPath(
"me?fields=birthday,gender,first_name,last_name,name_format,picture",
completionHandler: completionHandler
);

FBRequestConnection.startWithGraphPath 需要 FBRequestHandler,而不是 FBSessionStateHandler

关于swift - FBRequestConnection.startWithGraphPath swift 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24653953/

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