|  |      1fly2never      2013-05-20 17:23:19 +08:00 什么叫勾起来? | 
|  |      2offspring      2013-05-20 17:25:57 +08:00 表示看不懂... | 
|  |      4thedevil5032      2013-05-20 17:31:17 +08:00 | 
|  |      5alexrezit      2013-05-20 17:34:41 +08:00 楼主是这个意思么? if ([oo respondsToSelector:@selector(xx:)] { ... } | 
|  |      6anerevol      2013-05-21 09:25:39 +08:00 楼主是想问为什么会crash? 你要是用的mobileSubstrate hook的话,如果该类没有这个方法也不会crash的, 只是不会调用而已。 觉得crash跟hook本身没关系的,是其他地方的问题吧 | 
|  |      9alexrezit      2013-05-21 12:46:33 +08:00 | 
|  |      10kshatriya      2013-05-21 17:27:38 +08:00 method swizzle是方法混合器, 通过SEL查IMP, 然后把IMP搅在一起 | 
|  |      11kshatriya      2013-05-21 17:27:56 +08:00 void Swizzle(Class c, SEL orig, SEL new) { Method origMethod = class_getInstanceMethod(c, orig); Method newMethod = class_getInstanceMethod(c, new); if(class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod)); else method_exchangeImplementations(origMethod, newMethod); } | 
|  |      12kshatriya      2013-05-21 17:28:13 +08:00 强烈要求v2ex可以有代码格式化+高亮语法 | 
|  |      13loading      2013-05-21 17:31:30 +08:00 挂钩都是作恶的开始吧… | 
|  |      14kshatriya      2013-05-21 17:32:34 +08:00 crash普通情况下都是发送了空消息导致, 发之前做检查吧 hook一般都是先把orig函数的指针存一份, 然后覆盖, 在返回的时候返回给之前保存的orig函数指针, 只处理入参!别做多余的操作! 好混乱, 语死早啊 | 
|  |      15wezzard      2013-05-21 21:45:03 +08:00 method swizzling 不能上架麼? |