hcl416029105

Results 3 issues of hcl416029105

我在使用NSProxy替换NSURLSession原来的的delegate的时候,再使用AFNetwork的AFHTTPSessionManager的GET方法的时候崩溃了,不知道是什么原因,具体代码如下: static void swizzleClassMethod(Class theClass, SEL originalSelector, SEL swizzledSelector) { Method origMethod = class_getClassMethod(theClass, originalSelector); Method newMethod = class_getClassMethod(theClass, swizzledSelector); theClass = object_getClass((id)theClass); if(class_addMethod(theClass, originalSelector, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) class_replaceMethod(theClass, swizzledSelector, method_getImplementation(origMethod),...

question

Network监控里面用到的NSURLConnection,NSURLSession,CFNetwork,最底层还是使用的socket,我们要同时监控NSURLConnection,NSURLSession,CFNetwork。那为什么不直接监控iOS里面的socket呢?

duplicate
question

in delegate function didCompleteWithError,activeTasks has enumerateObjectsUsingBlock,alos in runningTasksSynchronizingQueue,activeTasks can revmoeObj or addObj。enum activeTasks in a queue,revmoeObj and addObj in runningTasksSynchronizingQueue。 i think there need o lock