Skip to content

Commit

Permalink
bug修复
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlinFeng committed Aug 17, 2015
1 parent 541d557 commit 21ae2e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion PhotoBrowser/Frameworks/Haneke/Cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class Cache<T : DataConvertible where T.Result == T, T : DataRepresentabl
}

deinit {
println("来了这里")

let notifications = NSNotificationCenter.defaultCenter()
notifications.removeObserver(memoryWarningObserver, name: UIApplicationDidReceiveMemoryWarningNotification, object: nil)
}
Expand Down
10 changes: 8 additions & 2 deletions PhotoBrowser/PhotoBroswer/View/ItemCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ extension ItemCell: UIScrollViewDelegate{

if cache == nil {cache = Cache<UIImage>(name: CFPBCacheKey)}

if format == nil{format = Format(name: photoModel.hostHDImgURL, diskCapacity: 10 * 1024 * 1024, transform: nil)}
if format == nil{format = Format(name: photoModel.hostHDImgURL, diskCapacity: 10 * 1024 * 1024, transform: { img in
return img
})}

cache.fetch(key: photoModel.hostHDImgURL, failure: {[unowned self] fail in

Expand All @@ -176,7 +178,11 @@ extension ItemCell: UIScrollViewDelegate{

self.imageV.image = self.photoModel.hostThumbnailImg

self.cache.fetch(URL: NSURL(string: self.photoModel.hostHDImgURL)!, formatName: self.photoModel.hostHDImgURL, failure: nil, success: {[unowned self] img in
self.cache.fetch(URL: NSURL(string: self.photoModel.hostHDImgURL)!, failure: {fail in

println("失败\(fail)")

}, success: {[unowned self] img in

if !NSUserDefaults.standardUserDefaults().boolForKey(CFPBShowKey) {return}

Expand Down

0 comments on commit 21ae2e6

Please sign in to comment.