Take the 2-minute tour ×



Something like this:

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
    return YES;

If not, what is the best alternative?

share|improve this question
Are you not looking for "deprecated", to mean "This will not be supported in a future release but works ok for now". On method signatures you can use: DEPRECATED_ATTRIBUTE –  James Webster Dec 18 '12 at 17:35
Not exactly. Deprecation will output a warning while the legacy code is still necessary, and this has the undesired effect of filling the output with warnings. –  hpique Dec 18 '12 at 17:38

3 Answers 3

up vote 3 down vote accepted

Try this:

#warning This pre-6.0 code isn't needed anymore
- (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)toInterfaceOrientation {
    return YES;

This code will cause a compiler warning once the Deployment Target is set to 6.0 or later.

share|improve this answer
Works like a charm. Thanks! –  hpique Dec 19 '12 at 11:37


use it on all methods BUT until you need it turn it quiet


share|improve this answer

Consider looking at how Apple marks that sort of thing in their framework classes. It seems they're making use of the Availability.h and AvailabilityInternal.h classes in the SDK.

share|improve this answer

Your Answer


