Have you ever tried to compile a tweak with a class such as:
KIK.Settings
or
Runkeeper.RKAccount
And receive an error such as "cannot use dot operator on a type"? Well, here's how you can fix it.
In your tweak.xm, it should look something like this:
%hook Account // This is the name you'd like to give the class. This could be 'Settings', 'Coins', 'Premium', whatever you like. I'll use "Account" for the sake of this tutorial.
-(bool)isPremium {
return TRUE;
}
%end
%ctor {
%init(Account = objc_getClass("Runkeeper.RKAccount")); // The "Account" should be the name you called your class above. The "Runkeeper.RKAccount" should be the actual class name itself. So the class name for example could be "Runkeeper.RKAccount" or whatever class you are trying to hack.
}
Now when you go ahead and compile, you shouldn't receive any errors concerning the class you've added!
Credits:
@AnotherLurker (All credits go this guy)
@Joka (Writing out this tutorial)