瀏覽代碼

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 年之前
父節點
當前提交
6f723c791e
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      YYCache/YYCache.m

+ 2 - 2
YYCache/YYCache.m

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