简体   繁体   English

IOS Parse的Anypic安装

[英]IOS Parse's Anypic Installation

I have downloaded Parse's app, Anypic, but cannot get it to run properly on my phone. 我已经下载了Parse的应用程序Anypic,但无法使其在手机上正常运行。 I have completed all of the required steps and it says "build succeeded" when I run it. 我已经完成了所有必需的步骤,并且在运行它时显示“构建成功”。

However, all that shows up is a black screen and a Facebook "login" button. 但是,显示的只是一个黑屏和一个Facebook“登录”按钮。 When the button is clicked, you can login to Facebook but then it just changes the button to say "log out" which is not exactly wha 单击该按钮后,您可以登录Facebook,但只是将按钮更改为说“注销”,这并不完全是

I have attached a picture with all my warnings I get. 我已附上一张收到所有警告的图片。 Are the warnings the issue or is there something else I need to change in the code? 是警告问题还是代码中需要更改的其他内容? Thanks! 谢谢!

在此处输入图片说明

You should change handleFacebookSession part to look like this: 您应该将handleFacebookSession部分更改为如下形式:

- (void)handleFacebookSession {
if ([PFUser currentUser]) {
    if (self.delegate && [self.delegate respondsToSelector:@selector(logInViewControllerDidLogUserIn:)]) {
        [self.delegate performSelector:@selector(logInViewControllerDidLogUserIn:) withObject:[PFUser currentUser]];
    }
    return;
}

NSArray *permissionsArray = @[ @"public_profile",
                               @"user_friends",
                               @"email"];

self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];

// Login PFUser using Facebook
[PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) {

    if (!user) {
        NSString *errorMessage = nil;
        if (!error) {
            NSLog(@"Uh oh. The user cancelled the Facebook login.");
            errorMessage = @"Uh oh. The user cancelled the Facebook login.";
        } else {
            NSLog(@"Uh oh. An error occurred: %@", error);
            errorMessage = [error localizedDescription];
        }
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Log In Error"
                                                        message:errorMessage
                                                       delegate:nil
                                              cancelButtonTitle:nil
                                              otherButtonTitles:@"Dismiss", nil];
        [alert show];
    } else {
        if (user.isNew) {
            NSLog(@"User with facebook signed up and logged in!");
        } else {
            NSLog(@"User with facebook logged in!");
        }

        if (!error) {
            [self.hud removeFromSuperview];
            if (self.delegate) {
                if ([self.delegate respondsToSelector:@selector(logInViewControllerDidLogUserIn:)]) {
                    [self.delegate performSelector:@selector(logInViewControllerDidLogUserIn:) withObject:user];
                }
            }
        } else {
            [self cancelLogIn:error];
        }
    }
}];}

Found here . 这里找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM