小编Mic*_*nna的帖子

如何在超过100 MB时将项目上传到Github?

我正在使用130MB的GoogleMaps pod,因此github不会让我上传我的项目.这是什么解决方法?

在此输入图像描述

github

6
推荐指数
1
解决办法
7850
查看次数

Facebook登录-停留在白色网页SWIFT

在我的LoginViewController中,我实现了FBSDKLoginButtonDelegate并导入了FBSDKLoginKit和FBSDKCoreKit。我在viewDidLoad中的代码如下所示:

    //setting up facebook login button
    var facebookLogin = FBSDKLoginButton()
    //want this button to conform to this protocol
    facebookLogin.delegate = self
    facebookLogin.readPermissions = ["public_profile", "email",   "user_friends"]
    facebookLogin.frame = CGRectMake(20, 359, 335, 30)
    self.view.addSubview(facebookLogin)
Run Code Online (Sandbox Code Playgroud)

这是按钮的代码:

    public func loginButton(loginButton: FBSDKLoginButton!, didCompleteWithResult 
         result: FBSDKLoginManagerLoginResult!, error: NSError!) {

    if error != nil {
        print(error.localizedDescription)
        return
    } else {
      print("No error")
      self.performSegueWithIdentifier("loginToFeed", sender: self)
    }

}
Run Code Online (Sandbox Code Playgroud)

登录后,页面停留在此白屏,而不是返回到应用程序。因此,我继续按“完成”以手动返回到应用程序,并且控制台打印出没有错误,并继续进行到提要。现在,下一个有趣的部分是尽管登录时没有错误,但我仍未登录。你知道这是怎么回事吗?我错过了一步吗?

ios facebook-login swift fbsdk

5
推荐指数
1
解决办法
3451
查看次数

为什么在调用“privateManagedObjectContext.perform”时会崩溃(从 com.apple.main-thread (Thread 1) Enqueued)?

在关闭网络请求时,我使用私有并发队列将对象插入到核心数据中,并在私有上下文中调用“执行”时发生崩溃。

控制台中的崩溃消息:

libc++abi.dylib:以未捕获的 NSException 类型异常终止

堆栈跟踪: 在此处输入图片说明

导致崩溃的代码:

API.sync(onlyMe, syncToken: syncToken) { success, syncResponse in
    CoreDataUtils.privateContext.perform { // crashes on this line
        ....
    }
}
Run Code Online (Sandbox Code Playgroud)

我的核心数据堆栈(不幸的是,目前位于 AppDelegate 而不是 CoreDataStack 类中):

lazy var persistentStoreCoordinator: NSPersistentStoreCoordinator = {
    // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail.
    // …
Run Code Online (Sandbox Code Playgroud)

core-data ios swift

5
推荐指数
1
解决办法
4930
查看次数

当我检查用户是否登录以便我可以有条件地提供静态文件时,为什么 req.session 未定义?

用户登录后,我将尝试提供静态文件。我应用了此处找到的答案,但实施起来遇到困难。

登录后,我在routes.js中有这样的内容:

app.post('/', function(req, res){
    AM.manualLogin(req.body['user'], req.body['pass'], function(e, o){
        if (!o){
            res.status(400).send(e);
        } else {
            req.session.user = o;
            if (req.body['remember-me'] == 'true'){
                res.cookie('user', o.user, { maxAge: 900000 });
                res.cookie('pass', o.pass, { maxAge: 900000 });
            }
            console.log(req.session);
            res.status(200).send(o);
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

我在请求的会话中设置用户。

在 app.js 里面我有:

var http = require('http');
var express = require('express');
var session = require('express-session');
var bodyParser = require('body-parser');
var errorHandler = require('errorhandler');
var cookieParser = require('cookie-parser');
var MongoStore = require('connect-mongo')(session);

var app = express();

app.locals.pretty = …
Run Code Online (Sandbox Code Playgroud)

node.js

0
推荐指数
1
解决办法
4249
查看次数

标签 统计

ios ×2

swift ×2

core-data ×1

facebook-login ×1

fbsdk ×1

github ×1

node.js ×1