Quellcode durchsuchen

Fix NSKeyedUnarchiver deprecation messages

master
lint vor 3 Jahren
Ursprung
Commit
405da04f34
1 geänderte Dateien mit 5 neuen und 2 gelöschten Zeilen
  1. +5
    -2
      tweak/Slide.xm

+ 5
- 2
tweak/Slide.xm Datei anzeigen

@@ -85,11 +85,14 @@ NSString *slidePostOverrideBodyHtml;
+ (UIColor *)accentColorForSub:(NSString *)subreddit {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
NSData *colorData = [userDefaults dataForKey:[NSString stringWithFormat:@"accent+%@", subreddit]];
UIColor *color = [NSKeyedUnarchiver unarchiveObjectWithData:colorData];
//UIColor *color = [NSKeyedUnarchiver unarchiveObjectWithData:colorData]; // deprecated
UIColor *color = [NSKeyedUnarchiver unarchivedObjectOfClass:[UIColor class] fromData:colorData error:nil];
if (color) {
return color;
} else {
UIColor *baseAccentColor = [NSKeyedUnarchiver unarchiveObjectWithData:[userDefaults dataForKey:@"accentcolor"]];
//UIColor *baseAccentColor = [NSKeyedUnarchiver unarchiveObjectWithData:[userDefaults dataForKey:@"accentcolor"]]; // deprecated
UIColor *baseAccentColor = [NSKeyedUnarchiver unarchivedObjectOfClass:[UIColor class] fromData:[userDefaults dataForKey:@"accentcolor"] error:nil];
if (baseAccentColor) {
return baseAccentColor;

Laden…
Abbrechen
Speichern