Parcourir la source

Application object Unretained Value

onevcat il y a 9 ans
Parent
commit
ae2789fcc1
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      Sources/ImageCache.swift

+ 1 - 1
Sources/ImageCache.swift

@@ -645,7 +645,7 @@ extension UIApplication {
     public static func kf_sharedApplication() -> UIApplication? {
     public static func kf_sharedApplication() -> UIApplication? {
         let selector = NSSelectorFromString("sharedApplication")
         let selector = NSSelectorFromString("sharedApplication")
         guard respondsToSelector(selector) else { return nil }
         guard respondsToSelector(selector) else { return nil }
-        return performSelector(selector).takeRetainedValue() as? UIApplication
+        return performSelector(selector).takeUnretainedValue() as? UIApplication
     }
     }
 }
 }
 #endif
 #endif