Jump to content

4 posts in this topic

Recommended Posts

Posted (edited)

Hi

 

I have a Problem with Compiling a Tweak.

I get this error:

 

Tweak.xm:2:1: error: missing context for method declaration

- (void)readPlist {

 

Tweak.xm:13:1: error: missing context for declaration

- (void)writeToPlist {

 

ewKxzGz.png

 

Whats wrong?

 

Inside Tweak.xm:

- (void)readPlist {
{
    NSString *filePath = @"/System/Library/CoreServices/SystemVersion.plist";
        NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
        
        NSString *value;
        value = [plistDict objectForKey:@"ProductVersion"];
      

}

- (void)writeToPlist {
{
    NSString *filePath = @"/System/Library/CoreServices/SystemVersion.plist";
        NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];
        
        [plistDict setValue:@"8.1.1" forKey:@"ProductVersion"];
        [plistDict writeToFile:filePath atomically: YES];


}
@end

Thanks :)

Updated by Flambob
Posted (edited)

-snip-

i think its because you added an extra "{"

- (void)readPlist {
NSString *filePath = @"/System/Library/CoreServices/SystemVersion.plist";
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];

NSString *value;
value = [plistDict objectForKey:@"ProductVersion"];


}

- (void)writeToPlist {
NSString *filePath = @"/System/Library/CoreServices/SystemVersion.plist";
NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];

[plistDict setValue:@"8.1.1" forKey:@"ProductVersion"];
[plistDict writeToFile:filePath atomically: YES];


}
@end

but that's just a thought, im not even sure if that's the problem

Updated by LeLenny420

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