diman4eg
diman4eg

Reputation: 57

Xcode 4.5 doesn't create some methods in viewController.m while creating a new class

I'm new in programming, and I studied Xcode a bit (version 4.2). There, if you chose for example a new single view application, it would create correspondind viewController.m file with methods, like:

-(void)viewDidUnload
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

and so on. But now I have downloaded Xcode 4.5, created a new a new single view application, and in the corresponding viewController.m file there are only 3 methods:

-(void)viewDidLoad
-(void)didReceiveMemoryWarning
-(void)dealloc

and that's all. How can I add all that methods autommatically when a new viewController.m file is created?

Upvotes: 0

Views: 106

Answers (1)

Stas
Stas

Reputation: 9935

These methods are not added because they are deprecated in iOS6. Instead of using - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation you should override these:

- (NSUInteger)supportedInterfaceOrientations and -(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation

As concerning viewDidLoad - views are no longer purged under low-memory conditions and so this method is never called

Upvotes: 1

Related Questions