从https://github.com/ipup/PPRevealSideViewController 里面摘抄出来
以后用到
// define some macros
#ifndef __has_feature
#define __has_feature(x) 0
#endif
#ifndef __has_extension
#define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
#endif
#if __has_feature(objc_arc) && __clang_major__ >= 3
#define PP_ARC_ENABLED 1
#endif // __has_feature(objc_arc)
#if PP_ARC_ENABLED
#define PP_RETAIN(xx) (xx)
#define PP_RELEASE(xx) xx = nil
#define PP_AUTORELEASE(xx) (xx)
#else
#define PP_RETAIN(xx) [xx retain]
#define PP_RELEASE(xx) [xx release], xx = nil
#define PP_AUTORELEASE(xx) [xx autorelease]
#endif
- (void) dealloc {
self.myLabel = nil;
#if !PP_ARC_ENABLED
[super dealloc];
#endif
}
UIBarButtonItem *right = [[UIBarButtonItem alloc] initWithTitle:@"Disable NonControlleur bounce"
style:UIBarButtonItemStylePlain
target:self
action:@selector(disableBouncing)];
self.navigationItem.rightBarButtonItem = PP_AUTORELEASE(right);