-1

Xcode でプロジェクトに取り組んでおり、 と からエラーが発生し didReceiveMemoryWarningますincomplete implementation。これはメインファイルです:

#import <UIKit/UIKit.h>
#import <Parse/Parse.h>

@interface LoginViewController : UIViewController

@property (strong, nonatomic) IBOutlet UIScrollView *scroller;


@property (weak, nonatomic) IBOutlet UITextField *FirstNameField;
@property (weak, nonatomic) IBOutlet UITextField *SurnameField;
@property (weak, nonatomic) IBOutlet UITextField *EmailField;
@property (weak, nonatomic) IBOutlet UITextField *PasswordField;
@property (weak, nonatomic) IBOutlet UITextField *ReenterPasswordField;


- (IBAction)RegisterAction:(id)sender;

@end

これは .m ファイルです:

#import "LoginViewController.h"


@interface LoginViewController ()

@end

@implementation LoginViewController
@synthesize scroller; 


- (void)viewDidLoad
{
    [super viewDidLoad];
    [scroller setScrollEnabled:YES];
    [scroller setContentSize:CGSizeMake(340, 600)];
}

- (void)viewDidAppear:(BOOL)animated
{
    PFUser *user = [PFUser currentUser];
    if (user.email != nil) {
        [self performSegueWithIdentifier:@"login" sender:self];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)RegisterAction:(id)sender {
    [_FirstNameField resignFirstResponder];
    [_SurnameField resignFirstResponder];
    [_EmailField resignFirstResponder];
    [_PasswordField resignFirstResponder];
    [_ReenterPasswordField resignFirstResponder];
    [self checkFieldsComplete];

    [self checkFieldsComplete];
}

- (void) checkFieldsComplete {
    if ([_FirstNameField.text isEqualToString:@""] || [_SurnameField.text isEqualToString:@""]|| [_EmailField.text isEqualToString:@""] || [_PasswordField.text isEqualToString:@""] || [_ReenterPasswordField.text isEqualToString:@""])  {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Oops" message: @"Make sure to complete every field" delegate: nil cancelButtonTitle: @"Ok" otherButtonTitles: nil];
        [alert show];
    } else {
        [self checkPasswordsMatch];
    }
}

- (void) checkPasswordsMatch {
    if (![_PasswordField.text isEqualToString:_ReenterPasswordField.text]) {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Oops" message: @"Passwords don't match" delegate: nil cancelButtonTitle: @"Ok" otherButtonTitles: nil];
        [alert show];
    }
}

- (void) registerNewUser {
    PFUser *newUser;
    newUser.username = [NSString stringWithFormat: _FirstNameField.text, _SurnameField.text];
    newUser.email = _EmailField.text;
    newUser.password = _PasswordField.text;

    [newUser signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
        if (!error) {
            NSLog(@"Welcome to Vici!");
            [self performSegueWithIdentifier:@"login"
                                      sender:self];
        } else {
            NSLog(@"There was an error in registration");
        }
    }];
}

@end

誰でも解決策を指摘できますか?

4

1 に答える 1