美文网首页
因为BlocksKit库导致融云选择拍摄照片失效问题

因为BlocksKit库导致融云选择拍摄照片失效问题

作者: 小马过海 | 来源:发表于2019-05-17 09:38 被阅读0次
    
     - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
        id realDelegate = self.realDelegate;
        if (realDelegate && [realDelegate   respondsToSelector:@selector(imagePickerController:didFinishPickingMediaWithInfo:)])
            [realDelegate imagePickerController:picker didFinishPickingMediaWithInfo:info];
    
        void (^block)(UIImagePickerController *, NSDictionary *) = [self blockImplementationForMethod:_cmd];
        if (block)   block(picker, info);
    }
    

    打印一下融云RCChatSessionInputBarControl所有实现的方法,可以发现他们实现的回调是一个过期的回调方法

    - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(nullable NSDictionary<UIImagePickerControllerInfoKey, id> *)editingInfo NS_DEPRECATED_IOS(2_0, 3_0);
    

    引以为鉴在设计第三方时也要考虑兼容DEPRECATED方法

    打印类所有方法

      void DumpObjcMethods(Class clz)  {
    
        unsigned int methodCount = 0;
        Method *methods = class_copyMethodList(clz, &methodCount);
        
        printf("Found %d methods on '%s'\n", methodCount, class_getName(clz));
        
        for (unsigned int i = 0; i < methodCount; i++) {
            Method method = methods[i];
            
            printf("\t'%s' has method named '%s' of encoding '%s'\n",
                   class_getName(clz),
                   sel_getName(method_getName(method)),
                   method_getTypeEncoding(method));
            
            /**
             *  Or do whatever you need here...
             */
        }    
        free(methods);
    }
    

    相关文章

      网友评论

          本文标题:因为BlocksKit库导致融云选择拍摄照片失效问题

          本文链接:https://www.haomeiwen.com/subject/cyxnaqtx.html