使用obj-c将现有UIImage从属性复制到新属性

时间:2017-03-12 11:53:33

标签: ios objective-c uiimage theos logos

所以我试图访问一个图像,但它没有用完,这就是我的代码的样子。任何人都知道我做错了什么?错误

Tweak.xm:36:36: warning: class method '+_currentNowPlayingArtwork' not found
      (return type defaults to 'id') [-Wobjc-method-access]
  test = [[MPUNowPlayingController currentNowPlayingArtwork] copy];

继承我的代码

@interface MPUNowPlayingController : NSObject {
UIImage* _cachedNowPlayingArtwork;
}
@property (nonatomic,readonly) UIImage * currentNowPlayingArtwork;
@property (assign,nonatomic) BOOL shouldUpdateNowPlayingArtwork;
-(BOOL)shouldUpdateNowPlayingArtwork;
-(void)setShouldUpdateNowPlayingArtwork:(BOOL)arg1 ;
-(UIImage *)currentNowPlayingArtwork;
@end

%hook OtherPlaceInSpringboard
//the part where i try to copy the image is below

UIImage *test = [[UIImage alloc] init];
  test = [[MPUNowPlayingController currentNowPlayingArtwork] copy];
  UIImageView *imageView = [[UIImageView alloc] initWithImage:test];
    imageView.alpha = 0.3; //Alpha runs from 0.0 to 1.0
  [self addSubview:imageView];

0 个答案:

没有答案