Skip to content
Guest Big Announcement

Tweak.xm: Missing Context Error

Featured Replies

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

-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

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.