- (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);
}
网友评论