From fb7450a39865d46af3a53c7dd8c77661c1c3d92c Mon Sep 17 00:00:00 2001 From: DogWang <15162709915@163.com> Date: Tue, 25 Oct 2016 10:00:46 +0800 Subject: [PATCH] fix bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.修改下载逻辑处理 2.修正下载后因为unowned导致错误判断self对象是否存在导致的闪退问题 --- .DS_Store | Bin 0 -> 6148 bytes .../UserInterfaceState.xcuserstate | Bin 0 -> 11256 bytes .../xcschemes/PhotoBrowser.xcscheme | 101 ++++++++++++++++++ .../xcschemes/xcschememanagement.plist | 27 +++++ .../Controller/PhotoBrowser+HUD.swift | 7 +- .../Controller/PhotoBrowser+Main.swift | 6 +- 6 files changed, 134 insertions(+), 7 deletions(-) create mode 100644 .DS_Store create mode 100644 PhotoBrowser.xcodeproj/project.xcworkspace/xcuserdata/DogWang.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 PhotoBrowser.xcodeproj/xcuserdata/DogWang.xcuserdatad/xcschemes/PhotoBrowser.xcscheme create mode 100644 PhotoBrowser.xcodeproj/xcuserdata/DogWang.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8d9b14a8c852f6075d9270862bb705e78f7ec44e GIT binary patch literal 6148 zcmeHKO-sW-5PchasCel~Jm%n8DEI?Hh~QD^SrC$9v4#X~(PMs+KgJ*An-8j`dMJX3 z&cMvuOm=p&Z(t__AeHN83QPcuse;)d%_k!7MRz1~&xn|GjSeLq(BTP>JF~;_8yS$? z9pefMW^F}%&)=MxJi{|;dK=8qYi956Z>O`mYkNIRc6q&TeA`u3vtHG}>-q9jSJ`X- zwrjo>-!DFX|BHS=m|!3n2nPNc1FYF1<0Hec!9Xw&3~U&X`yrr0ubdl zQiWsbB_t+yEF1?zzM&)wC0c0m79&|W{khL890x-SNAl()`Oe8Zl%%_J{amLb6^3Dh zfnZ>pfdhM-Nd3R~y8qt}il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<2HvI>k<@vyW5hv^bs4WM`_guQS7$<;-^GI)^)poRghXou$rl=XB>B zXPtAdv(Y)v+2ow>WX@Zh>ztdM_dDC2oz88}z0QZ7k2xQA9&jFX9(KOreAoGf^OEzj z^E>Ac&YxVwC3Z<&a+lJjb|tu6t^uxLu92=$t~^(PtH@R6a=U!48(m9XH@jB2ZgZ`6 z-RWBATJPHF+U@$g>p|Beu6?d2TnAl;T+g_UyH2|D*^Zx@{Lk#Z# literal 0 HcmV?d00001 diff --git a/PhotoBrowser.xcodeproj/xcuserdata/DogWang.xcuserdatad/xcschemes/PhotoBrowser.xcscheme b/PhotoBrowser.xcodeproj/xcuserdata/DogWang.xcuserdatad/xcschemes/PhotoBrowser.xcscheme new file mode 100644 index 0000000..b9bc0a2 --- /dev/null +++ b/PhotoBrowser.xcodeproj/xcuserdata/DogWang.xcuserdatad/xcschemes/PhotoBrowser.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PhotoBrowser.xcodeproj/xcuserdata/DogWang.xcuserdatad/xcschemes/xcschememanagement.plist b/PhotoBrowser.xcodeproj/xcuserdata/DogWang.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..9fb2a9b --- /dev/null +++ b/PhotoBrowser.xcodeproj/xcuserdata/DogWang.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + PhotoBrowser.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 89CA44421B7F96030061FEFC + + primary + + + 89CA44571B7F96030061FEFC + + primary + + + + + diff --git a/PhotoBrowser/PhotoBrowser/Controller/PhotoBrowser+HUD.swift b/PhotoBrowser/PhotoBrowser/Controller/PhotoBrowser+HUD.swift index 33f9844..c9d5cbf 100644 --- a/PhotoBrowser/PhotoBrowser/Controller/PhotoBrowser+HUD.swift +++ b/PhotoBrowser/PhotoBrowser/Controller/PhotoBrowser+HUD.swift @@ -26,9 +26,10 @@ extension PhotoBrowser{ if autoDismiss == -1 {return} - dispatch_after(dispatch_time(DISPATCH_TIME_NOW,Int64(autoDismiss * Double(NSEC_PER_SEC))), dispatch_get_main_queue(), {[unowned self] () -> Void in - - self.dismissHUD() + dispatch_after(dispatch_time(DISPATCH_TIME_NOW,Int64(autoDismiss * Double(NSEC_PER_SEC))), dispatch_get_main_queue(), {[weak self] () -> Void in + if self != nil { + self!.dismissHUD() + } }) } diff --git a/PhotoBrowser/PhotoBrowser/Controller/PhotoBrowser+Main.swift b/PhotoBrowser/PhotoBrowser/Controller/PhotoBrowser+Main.swift index 279f168..7ae9064 100644 --- a/PhotoBrowser/PhotoBrowser/Controller/PhotoBrowser+Main.swift +++ b/PhotoBrowser/PhotoBrowser/Controller/PhotoBrowser+Main.swift @@ -72,12 +72,10 @@ extension PhotoBrowser{ if (didFinishSavingWithError as NSError?) == nil { showHUD("保存失败", autoDismiss: 2) - } - else{ - showHUD("保存成功", autoDismiss: 2) - //记录 photoArchiverArr.append(page) + }else{ + showHUD("保存失败", autoDismiss: 2) } }