我的viewController中有facebook按钮。我把它设为:
var loginButton: FBSDKLoginButton = FBSDKLoginButton()
loginButton.center = self.view.center
self.view.addSubview(loginButton)
一切正常,但我希望在用户登录后得到回复。我这样做:
class LogInSocialController: UIViewController, FBSDKLoginButtonDelegate
并调用这两个函数:
func loginButton(loginButton: FBSDKLoginButton!, didCompleteWithResult result: FBSDKLoginManagerLoginResult!, error: NSError!) {
print("User Logged In")
}
func loginButtonDidLogOut(loginButton: FBSDKLoginButton!) {
print("User Logged Out")
}
但他们没有回应我,我的日志中没有任何结果(打印结果)。
有什么问题?
答案 0 :(得分:1)
只需添加以下行:
static List<string> allsubdirs = new List<string>();
static void ProcessFile(string path) {/* ... */}
public static void ApplyAllFiles(string folder, Action<string> fileAction)
{
foreach (string file in Directory.GetFiles(folder))
{
fileAction(file);
}
foreach (string subDir in Directory.GetDirectories(folder))
{
try
{
ApplyAllFiles(subDir, fileAction);
allsubdirs.Add(subDir);
}
catch
{
// swallow, log, whatever
}
}
}
您的代码如下:
loginButton.delegate = self