Jump to content

tweak.xm errors and .plist question


Go to solution Solved by AnotherLurker,

4 posts in this topic

Recommended Posts

Posted

hi im new and i am having trouble with my tweak.xm code

  %hook YTVideoMetadataCell

-(void) setOfflineButtonVisible:(bool)argument1 dimmed:(bool)argument2 animated:(bool) {
if(GetPrefBool(@"key11")) {
argument1 = TRUE;
}
return %orig;
}
%end
 
%hook YTPlaylistHeaderView
-(void) setOfflineButtonVisible:(bool)argument1 dimmed:(bool) {
if(GetPrefBool(@"key11")) {
argument1 = TRUE;
}
return %orig;
}
%end
thats my tweak .xm and i got that from flex^^
Tweak.xm:58:168: error: expected class member or base class name
  ...self, SEL _cmd, bool argument1, bool argument2):(bool) {
                                                     ^
Tweak.xm:58:168: error: expected '{' or ','
Tweak.xm:58:167: error: only constructors take base initializers
  ...self, SEL _cmd, bool argument1, bool argument2):(bool) {
                                                    ^
Tweak.xm:67:145: error: expected class member or base class name
  ...self, SEL _cmd, bool argument1):(bool) {
                                     ^
Tweak.xm:67:145: error: expected '{' or ','
Tweak.xm:67:144: error: only constructors take base initializers
  ...self, SEL _cmd, bool argument1):(bool) {
this is error^^
also in preference bundel how would i make a switch disable/greyed out if a certain switch is turned on thanks
 
 
Posted

Not sure if this would help anything, but I don't think you're supposed to have a space in your method, like where it says "argument1 dimmed," that should just be "argument1" or "dimmed." Something along those lines


Also, both methods have (bool) at the end, but no name for that bool. Although there may be nothing in Flex for it, put something after those

  • Solution
Posted (edited)
%hook YTVideoMetadataCell
- (void)setOfflineButtonVisible:(bool)argument1 dimmed:(bool)argument2 animated:(bool)argument3 {
     if(GetPrefBool(@"key11")) {
        argument1 = TRUE;
     }

     return %orig;
}
%end
 
%hook YTPlaylistHeaderView
- (void)setOfflineButtonVisible:(bool)argument1 dimmed:(bool)argument2 {
     if(GetPrefBool(@"key11")) {
        argument1 = TRUE;
     }

     return %orig;
}
%end

You need to add names to all the arguments, I added 'argument3' to animated, and 'argument2' to dismissed

Updated by JustRick
Posted

 

%hook YTVideoMetadataCell
- (void)setOfflineButtonVisible:(bool)argument1 dimmed:(bool)argument2 animated:(bool)argument3 {
     if(GetPrefBool(@"key11")) {
        argument1 = TRUE;
     }

     return %orig;
}
%end
 
%hook YTPlaylistHeaderView
- (void)setOfflineButtonVisible:(bool)argument1 dimmed:(bool)argument2 {
     if(GetPrefBool(@"key11")) {
        argument1 = TRUE;
     }

     return %orig;
}
%end
You need to add names to all the arguments, I added 'argument3' to animated, and 'argument2' to dismissed

This definitely helped but my other question was how would I be able to disable a switch from being turned on if a certain other switch is enabled. What would I need to type/code?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines