일부 메타 정보에 대해서는 으로 UIButton
을 확장하고 싶습니다. 내가 어떻게 할 수 있니?UIButton에 NSString 카테고리 확장 추가
나는이로 시작하는 오전 :
@interface UIButton (neoUtils)
+ (UIButton *)neoName:(NSString *)buttonName;
@end
와하는 .m
#import "UIButton+NAME.h"
@implementation UIButton (neoUtils)
+ (UIButton *)neoName:(NSString *)buttonName {
UIButton *button = [UIButton neoName:buttonName];
NSLog(@"%@",button);
return button;
}
@end
이 옳은 길인가를? 그리고 만약 그렇다면 어떻게 사용합니까?
이 질문은 중복되지 않지만 이전에는 다른 상황에서 대답되었습니다. http://stackoverflow.com/questions/10414718/subclassing-nsnumber를 참조하십시오. –
그게 내가 찾는 것 같다. 감사합니다. – malaki1974