tap_hook
(tap_hook)
1
- (id)initWithTitle:(NSString *)title delegate:(id<UIActionSheetDelegate>)delegate cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSString *)destructiveButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...
UIActionSheet的初始化函数如上,在iOSOpenDev里面不知道该怎么Hook,直接写会编译过不了,求大神指教啊。
可变参数的函数貌似不能使用MobileSubstrate来hook,你可以试试hook
- (id)initWithTitle:(NSString *)title delegate:(id<UIActionSheetDelegate>)delegate cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSString *)destructiveButtonTitle otherButtonTitles:(NSString *)otherButtonTitles
或者把你要做什么描述一下,应该会有更好更合理的解决办法
tap_hook
(tap_hook)
3
想动态修改UIActionSheet,添加几个自定义的按钮,本来想在初始化函数那边直接弄比较方便,但是初始化函数无法拦截,你说的那样拦截也没用,后来直接去找UIActionSheet的私有方法实现了这功能了。
动态添加按钮不是公开的吗?addButtonWithTitle:啊
确实是这样,那我也想不到什么好的方法了,私有函数能解决就好