'Error with "Self" [Self presentmodalviewcontroller]
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
PFLogInViewController *login = [[PFLogInViewController alloc]init];
login.fields = PFLogInFieldsUsernameAndPassword | PFLogInFieldsLogInButton;
[self presentModalViewController:login animated:YES];
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end
I get an error saying "Self" is depreciated in iOS 6. Any Ideas on how to fix this? This is for the login screen on Parse.
Solution 1:[1]
Use presentViewController:animated:completion: instead.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | gutenbergn |
