转自http://www.tuicool.com/articles/FZn6Rfa
#import <UIKit/UIKit.h>
@interfaceUIViewController (Base)
@property(nonatomic,strong)NSMutableArray* dataArray;
@end
----------------------------------------------------------------------------------
#import <objc/runtime.h>
@implementationUIViewController (Base)
- (NSMutableArray*)dataArray{
returnobjc_getAssociatedObject(self,@selector(dataArray));
}
- (void)setDataArray:(NSMutableArray*)dataArray{
objc_setAssociatedObject(self,@selector(dataArray), dataArray,OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
@end