Created
September 12, 2013 14:10
-
-
Save hborders/6538030 to your computer and use it in GitHub Desktop.
Demonstrates a category that should trigger deprecation warnings for an Objective-C method, but doesn't.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UINavigationController (Deprecations) | |
- (id)initWithRootViewController:(UIViewController *)rootViewController __attribute__((deprecated)); | |
@end | |
// no implementation of UINavigationController (Deprecations) should be necessary. I just want to add the attribute | |
// should this be a class extension instead of a category? | |
@interface SomethingThatUsesNavigationController : UIViewController | |
@end | |
@implementation | |
- (IBAction)buttonPressed { | |
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:[UIViewController new]]; // this should trigger a deprecation warning, but doesn't for me. | |
[self presentViewController:navigationController animated:YES completion:NULL]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment