فهرست منبع

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 {