Copying existing UIImage to new one from property using obj-c

65 Views Asked by At

So I'm trying to access an image but it's not working out, here's what my code looks like. Anyone have any idea what Im doing wrong? error below

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

heres my code

@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

There are 0 best solutions below