我已从原始开发人员的存储库中克隆了此调整,希望更改以下事实:当它根据时间设置墙纸时,会将其设置为动态。我通读了PLStaticWallpaperImageViewController属性,发现setMovement有一个选项。当我尝试制作包装时,它抛出一个错误,说它无效。我不了解object-c,并认为这将是设置属性的方式,有人可以帮我解决这个问题吗?
static void setWallpaperForWallpaperMode(NSString* path, int wallpaperMode)
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
UIImage *rawImage = [UIImage imageWithContentsOfFile:path];
if(rawImage) {
UIImage *image = sizeImage(rawImage, CGSizeMake(screenSize.width*screenScale, screenSize.height*screenScale));
image = [UIImage imageWithCGImage:image.CGImage scale:rawImage.scale orientation:rawImage.imageOrientation];
[[NSOperationQueue mainQueue] addOperationWithBlock:^() {
@try {
PLStaticWallpaperImageViewController *wallpaperViewController = [[PLStaticWallpaperImageViewController alloc] initWithUIImage:image];
wallpaperViewController.saveWallpaperData = YES;
wallpaperViewController.setMovement = false;
int wallpaperModeSet = wallpaperMode;
object_setInstanceVariable(wallpaperViewController, "_wallpaperMode", *(int **)&wallpaperModeSet);
[wallpaperViewController _savePhoto];
} @catch(NSException* ex) {
}
}];
}
});
}
目标是在移动设备时将其设置为墙纸的静止或禁用运动。这是引发的错误。
1 error generated.
make[3]: *** [/var/root/theos/makefiles/instance/rules.mk:269: /var/root/AutoWall/autowallhooks/.theos/obj/debug/armv7//var/root/AutoWall/autowallhooks/Tweak.xm.802adc51.o] Error 1
==> Compiling /var/root/AutoWall/autowallhooks/Tweak.xm (arm64)…
/var/root/AutoWall/autowallhooks/Tweak.xm:121:30: error: property 'setMovement' not found on object of type 'PLStaticWallpaperImageViewController *'
wallpaperViewController.setMovement = false;