Bläddra i källkod

Fix convenience creation methods

It's easier to subclass YYCache if the convience creation methods use
the current class type instead of a hardcoded one.
Yiming Tang 9 år sedan
förälder
incheckning
6f723c791e
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      YYCache/YYCache.m

+ 2 - 2
YYCache/YYCache.m

@@ -43,11 +43,11 @@
 }
 }
 
 
 + (instancetype)cacheWithName:(NSString *)name {
 + (instancetype)cacheWithName:(NSString *)name {
-	return [[YYCache alloc] initWithName:name];
+    return [[self alloc] initWithName:name];
 }
 }
 
 
 + (instancetype)cacheWithPath:(NSString *)path {
 + (instancetype)cacheWithPath:(NSString *)path {
-    return [[YYCache alloc] initWithPath:path];
+    return [[self alloc] initWithPath:path];
 }
 }
 
 
 - (BOOL)containsObjectForKey:(NSString *)key {
 - (BOOL)containsObjectForKey:(NSString *)key {