嗨,大家好,我试图让图像显得每当我的方法被调用。
这里是我的代码
#import <UIKit/UIKit.h>
#import <substrate.h>
#import <Foundation/Foundation.h>
#import <UIKit/UISaveToCameraRollActivity.h>
#import <UIKit/_UIImageViewExtendedStorage.h>
#import <UIKit/_UIOnePartImageView.h>
#import <UIKit/_UIPrefTableCellPiece.h>
#import <UIKit/_UIStretchableImage.h>
#import <UIKit/_UISwitchSlider.h>
#import <UIKit/_UITableViewCellDeleteConfirmationControl.h>
#import <UIKit/UIImage.h>
%hook UISaveToCameraRollActivity
-(void)performActivity {
%orig;
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake (100, 200, 100, 100)];
imageView.image = [UIImage imageWithContentsofFile:@"/Users/Cyrus/test/pic.png"];
}
%end
这是我的错误代码,我不断收到错误的UIImage可能不+ imageWithContentsofFile回应。 有人能帮助我吗?
Tweak.xm:17: warning: ‘UIImage’ may not respond to ‘+imageWithContentsofFile:’
Tweak.xm:17: warning: (Messages without a matching method signature
Tweak.xm:17: warning: will be assumed to return ‘id’ and accept
Tweak.xm:17: warning: ‘...’ as arguments.)
谢谢你们我真的很感谢所有帮助。