我在根视图控制器中的视图中以模态方式调用登录视图确实加载方法,但是当我解除模态视图控制器时它只是重新出现!有什么建议么?听到代码:
** 。H **
//
// FirstViewController.h
// Voyager
//
// Created by Peter Unger on 9/1/13.
// Copyright (c) 2013 Penumbra Software. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
@interface FirstViewController : UIViewController
@end
@interface DefaultSettingsViewController :
UIViewController <PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate>
@end
** .m **
//
// FirstViewController.m
// Voyager
//
// Created by Peter Unger on 9/1/13.
// Copyright (c) 2013 Penumbra Software. All rights reserved.
//
#import "FirstViewController.h"
#import <Parse/Parse.h>
@interface FirstViewController ()
@end
@implementation FirstViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
PFLogInViewController *login = [[PFLogInViewController alloc] init];
login.fields = PFLogInFieldsUsernameAndPassword | PFLogInFieldsLogInButton | PFLogInFieldsSignUpButton;
login.delegate = (id)self;
login.signUpController.delegate = (id)self;
[self presentViewController:login animated:YES completion:nil];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)logInViewController:(PFLogInViewController *)logInController didLogInUser:(PFUser *)user {
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)signUpViewController:(PFSignUpViewController *)signUpController didSignUpUser:(PFUser *)user {
[self dismissViewControllerAnimated:YES completion:nil];
}
@end