Domanda

When making a jailbreak tweak I know that when you need to modify an argument you call something like this

-(void) setSlowDownFactor:(float)arg1 {
     %orig(0.6)
}

But when you have multiple arguments in a method like this

- (id)initWithRequest:(id)arg1 backgroundColor:(id)arg2 foregroundColor:(id)arg3 {

}

How would you change some of the arguments but not all of them? (I want to change backgroundColor and foregroundColor)

È stato utile?

Soluzione

- (id)initWithRequest:(id)arg1 backgroundColor:(id)arg2 foregroundColor:(id)arg3 {
    UIColor *red = [UIColor redColor];
    UIColor *blue = [UIColor blueColor];
    return %orig(arg1, red, blue);
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top