我正在使用 Parse 为应用程序制作登录页面。我收到错误“'UIResponder' 的可见@interface 声明选择器'viewDidAppear'”我还收到“'UIResponder' 的可见@interface 声明选择器'presentViewController:animated:present'”
所以,在我的 AppDelegate.m 我有:
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];//I GET THE ERROR HERE
if (![PFUser currentUser]) { // No user logged in
// Create the log in view controller
PFLogInViewController *logInViewController = [[PFLogInViewController alloc] init];
[logInViewController setDelegate:self]; // Set ourselves as the delegate
// Create the sign up view controller
PFSignUpViewController *signUpViewController = [[PFSignUpViewController alloc] init];
[signUpViewController setDelegate:self]; // Set ourselves as the delegate
// Assign our sign up controller to be displayed from the login controller
[logInViewController setSignUpController:signUpViewController];
// Present the log in view controller
[self presentViewController:logInViewController animated:YES completion:NULL];//I GET THE ERROR HERE
}
}
在我的 AppDelegate.h 中:
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
// Implement both delegates
@interface DefaultSettingsViewController :
UIViewController <PFLogInViewControllerDelegate, PFSignUpViewControllerDelegate>
@end
我该如何解决这个问题?