Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用了过期的loadImageWithTag接口,该接口rn0.32以后废弃,造成无法编译 #12

Open
wangzikai opened this issue Aug 28, 2016 · 3 comments

Comments

@wangzikai
Copy link

No description provided.

@lipingruan
Copy link

@wangzikai 请问有解决方法吗?

@sunnylqm @lvbingru @tdzl2003

@akerdi
Copy link

akerdi commented Sep 20, 2016

same issue

@akerdi
Copy link

akerdi commented Sep 20, 2016

没去管传的参数,先完成任务,我前往RCTImageLoader.h添加如下:
@interface RCTImageLoader (Deprecated)

  • (RCTImageLoaderCancellationBlock)loadImageWithTag:(NSString *)imageTag
    callback:(RCTImageLoaderCompletionBlock)callback
    __deprecated_msg("Use loadImageWithURLRequest:callback: instead");
  • (RCTImageLoaderCancellationBlock)loadImageWithTag:(NSString *)imageTag
    size:(CGSize)size
    scale:(CGFloat)scale
    resizeMode:(RCTResizeMode)resizeMode
    progressBlock:(RCTImageLoaderProgressBlock)progressBlock
    completionBlock:(RCTImageLoaderCompletionBlock)completionBlock
    __deprecated_msg("Use loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:completionBlock: instead");
  • (RCTImageLoaderCancellationBlock)loadImageWithoutClipping:(NSString *)imageTag
    size:(CGSize)size
    scale:(CGFloat)scale
    resizeMode:(RCTResizeMode)resizeMode
    progressBlock:(RCTImageLoaderProgressBlock)progressBlock
    completionBlock:(RCTImageLoaderCompletionBlock)completionBlock
    __deprecated_msg("Use loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:completionBlock: instead");
    @EnD
    在.m的implement里面添加:
  • (RCTImageLoaderCancellationBlock)loadImageWithTag:(NSString *)imageTag
    callback:(RCTImageLoaderCompletionBlock)callback
    {
    RCTLogWarn(@"[RCTImageLoader loadImageWithTag:callback:] is deprecated. Instead use [RCTImageLoader loadImageWithURLRequest:callback:]");
    return [self loadImageWithURLRequest:[RCTConvert NSURLRequest:imageTag]
    callback:callback];
    }
  • (RCTImageLoaderCancellationBlock)loadImageWithTag:(NSString *)imageTag
    size:(CGSize)size
    scale:(CGFloat)scale
    resizeMode:(RCTResizeMode)resizeMode
    progressBlock:(RCTImageLoaderProgressBlock)progressBlock
    completionBlock:(RCTImageLoaderCompletionBlock)completionBlock
    {
    RCTLogWarn(@"[RCTImageLoader loadImageWithTag:size:scale:resizeMode:progressBlock:completionBlock:] is deprecated. Instead use [RCTImageLoader loadImageWithURLRequest:size:scale:clipped:resizeMode:progressBlock:completionBlock:]");
    return [self loadImageWithURLRequest:[RCTConvert NSURLRequest:imageTag]
    size:size
    scale:scale
    clipped:YES
    resizeMode:resizeMode
    progressBlock:progressBlock
    completionBlock:completionBlock];
    }

编译通过,先用着吧,改源码也只能这样,,哈哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants