%hook 用得最多的

例子:
%hook SBTelephonyManager

%end

%new (v@:) 新建方法 v是返回值@代表参数名
%new(v@:@i)
- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;

%subclass 子类化一个类
%subclass MyAppicon : SBApplicationIcon

%group 分组
%group GFirmware5x
%end

%init 初始化分组和group相对应

%ctor 构建一个初始化函数

%c 应该是前向声明 -- 这个很有用
例:
[[%c(SBTelephonyManager) sharedTelephonyManager]operatorBundleChanged];
实际会变成:
[[_logos_static_class_lookup$SBTelephonyManager() sharedTelephonyManager]operatorBundleChanged];

%log 打系统日志,函数名参数值都能打出来

%orig 调用默认函数


权威参考资料:http://iphonedevwiki.net/index.php/Logos

你可能感兴趣的文章

评论区

发表评论

必填

选填

选填

必填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。