我正在使用 Facebook SDK 快速获取用户个人资料数据,但调用 FBRequestConnection.startWithGraphPath:completionHandler: 会迅速崩溃。
我会留下我认为是日志的相关部分
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
);