当我的方法被激活时,我正在尝试显示图像。我把所有的代码都写下来了,我没有得到任何错误,但图像不会显示。这是我的 Tweak.xm 文件。
#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>
#import <UIKit/_UITableViewUpdateSupport.h>
#import <UIKit/UI9PartImageView.h>
#import <UIKit/UIAlertSheetTextField.h>
#import <UIKit/UIAutocorrectImageView.h>
#import <UIKit/UIClippedImageView.h>
#import <UIKit/UICompositeImageView.h>
#import <UIKit/UIImageAndTextTableCell.h>
#import <UIKit/UIImageView2.h>
#import <UIKit/UIOnePartImageView.h>
#import <UIKit/UITabBarSwappableImageView.h>
#import <UIKit/UITableViewCell2.h>
#import <UIKit/UITableViewCellEditControl.h>
#import <UIKit/UIThreePartImageView.h>
#define kBundlePath @"/Library/MobileSubstrate/DynamicLibraries/image.bundle"
%hook UISaveToCameraRollActivity
-(void)performActivity {
%orig;
NSBundle *bundle = [[NSBundle alloc] initWithPath:kBundlePath];
NSString *imagePath = [bundle pathForResource:@"pic" ofType:@"png"];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake (100, 200, 100, 100)];
imageView.image = [UIImage imageWithContentsOfFile:imagePath];
}
%end
这是我的 MakeFile
include theos/makefiles/common.mk
TWEAK_NAME = test
test_FILES = Tweak.xm
test_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/tweak.mk
BUNDLE_NAME = image
image_INSTALL_PATH = /Library/MobileSubstrate/DynamicLibraries
image_FRAMEWORKS = UIKit
include $(THEOS_MAKE_PATH)/bundle.mk
谢谢大家,我真的很感谢所有的帮助,我知道我有很多标题,但是这个项目在某一时刻有很多不同的东西。请让我知道发生了什么,因为就像我说的那样,我什至没有收到任何错误代码。谢谢!