0

所以我试图访问一个图像,但它没有成功,这就是我的代码的样子。有人知道我做错了什么吗?下面的错误

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];
4

0 回答 0