For example, when I declare subclass of existing class, I can write as below in theos:
%subclass NEWCLASS: EXISTINGCLASS
- (void)overridemethod {
//code
}
%new(v@:)
- (void)newmethod {
//code
}
%end
But I don't know how to declare member or property variables of new class...
What should I do?
OK, I got it.
But there are errors when I compile package..
I wrote code as below:
%subclass SBIconSubClass: SBIcon
%new
- (NSString *)aString {
return objc_getAssociatedObject(self, @selector(aString));
}
%new
- (void)setAString:(NSString *)value {
objc_setAssociatedObject(self, @selector(aString), value, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (id)application {
self.aString = @"Test";
NSLog(@"%@",self.aString);
return %orig;
}
%end
and error: