What do% new and% class mean in terms of MobileSubstrate settings? For instance:
%class TPBottomLockBar;
and
%new( v@ :)
Sorry for the double question!
These are both Logos designs. %new designed to add new methods to the class at runtime, and its syntax is %new(typeencoding) ; you can get information about the Objective-C encoding type in the Apple Objective-C documentation. Note that the first two arguments for these methods are always id and SEL, so the two second characters of the encoding of your type must be " @: ". The first character is the return type, and everything else is your set of custom arguments.
%new
%new(typeencoding)
@:
As an example, this is a pretty useful method:
%hook NSMutableString %new( v@ :) - (void)appendAwesomeThings { [self appendString:@"Awesome."]; } %end
(actually this probably doesn't work, since NSString is a class cluster, but it serves as an example no less!)
%class - obsolete directive for direct declaration of the class that will be used at runtime; It has been replaced with %c(ClassName) , which should be used inline. For instance,
%class
%c(ClassName)
[[%c(NSString) alloc] initWithString:@"Cool."];