From 4511d81ca8709ac78be3ea8f5f501846cc935a6e Mon Sep 17 00:00:00 2001 From: Vineet Choudhary Date: Wed, 18 Apr 2018 18:35:05 +0530 Subject: [PATCH 1/3] change delete build shortcut to "delete" key only --- AppBox/ViewController/Storyboard/Main.storyboard | 1 - 1 file changed, 1 deletion(-) diff --git a/AppBox/ViewController/Storyboard/Main.storyboard b/AppBox/ViewController/Storyboard/Main.storyboard index 4f72d7e4..e31e264f 100644 --- a/AppBox/ViewController/Storyboard/Main.storyboard +++ b/AppBox/ViewController/Storyboard/Main.storyboard @@ -1565,7 +1565,6 @@ DQ CA - From edf1407e321071cce425e3211e5ef88c0b245adf Mon Sep 17 00:00:00 2001 From: Vineet Choudhary Date: Thu, 19 Apr 2018 18:37:17 +0530 Subject: [PATCH 2/3] Removed image category --- AppBox.xcodeproj/project.pbxproj | 6 ----- .../xcshareddata/xcschemes/AppBox.xcscheme | 2 +- AppBox/AppBoxPrefixHeader.pch | 1 - AppBox/Common/Extensions/NSImage+Image.h | 15 ----------- AppBox/Common/Extensions/NSImage+Image.m | 26 ------------------- .../QRCodeViewController.h | 2 +- .../QRCodeViewController.m | 12 ++++++--- 7 files changed, 11 insertions(+), 53 deletions(-) delete mode 100644 AppBox/Common/Extensions/NSImage+Image.h delete mode 100644 AppBox/Common/Extensions/NSImage+Image.m diff --git a/AppBox.xcodeproj/project.pbxproj b/AppBox.xcodeproj/project.pbxproj index 02e7da94..adae4210 100644 --- a/AppBox.xcodeproj/project.pbxproj +++ b/AppBox.xcodeproj/project.pbxproj @@ -50,7 +50,6 @@ E101D2BE200DE7E00062078B /* xcpretty in CopyFiles */ = {isa = PBXBuildFile; fileRef = E101D22F200DE0170062078B /* xcpretty */; }; E10B821E1DF043EA00BBE0CD /* GetSchemeScript.sh in Resources */ = {isa = PBXBuildFile; fileRef = E172E13B1DEEB3B900405EF2 /* GetSchemeScript.sh */; }; E10B82221DF0498800BBE0CD /* TeamIDScript.sh in Resources */ = {isa = PBXBuildFile; fileRef = E10B82211DF0498600BBE0CD /* TeamIDScript.sh */; }; - E114C46720872AA5008FC59C /* NSImage+Image.m in Sources */ = {isa = PBXBuildFile; fileRef = E114C46620872AA5008FC59C /* NSImage+Image.m */; }; E11633991E558635005EAB31 /* MobileProvision.m in Sources */ = {isa = PBXBuildFile; fileRef = E11633981E558635005EAB31 /* MobileProvision.m */; }; E119EF601E373C9B00A7798E /* ALAppStore.sh in Resources */ = {isa = PBXBuildFile; fileRef = E191F7C21E1E7B2A00D2A590 /* ALAppStore.sh */; }; E12E6D0A1D8FC77D0054814D /* DashboardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E12E6D081D8FC77D0054814D /* DashboardViewController.m */; }; @@ -295,8 +294,6 @@ E101D25C200DE0170062078B /* version.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = version.rb; sourceTree = ""; }; E101D25D200DE0170062078B /* xcpretty.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = xcpretty.rb; sourceTree = ""; }; E10B82211DF0498600BBE0CD /* TeamIDScript.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = TeamIDScript.sh; sourceTree = ""; }; - E114C46520872AA5008FC59C /* NSImage+Image.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSImage+Image.h"; sourceTree = ""; }; - E114C46620872AA5008FC59C /* NSImage+Image.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSImage+Image.m"; sourceTree = ""; }; E11633971E558635005EAB31 /* MobileProvision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileProvision.h; sourceTree = ""; }; E11633981E558635005EAB31 /* MobileProvision.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MobileProvision.m; sourceTree = ""; }; E119EF5F1E3735EA00A7798E /* XCodePath.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = XCodePath.sh; sourceTree = ""; }; @@ -478,8 +475,6 @@ DB1C84402079F54E007AC74C /* NSString+String.m */, DB5385682083622A004BFC84 /* NSURL+URL.h */, DB5385692083622A004BFC84 /* NSURL+URL.m */, - E114C46520872AA5008FC59C /* NSImage+Image.h */, - E114C46620872AA5008FC59C /* NSImage+Image.m */, ); path = Extensions; sourceTree = ""; @@ -1496,7 +1491,6 @@ E16437D71D743A4E00CE8B7E /* main.m in Sources */, DB831BCB1FF6B5780065B646 /* ABHudViewController.m in Sources */, E1853392200E084500E88529 /* ABLog.m in Sources */, - E114C46720872AA5008FC59C /* NSImage+Image.m in Sources */, E1902B481E16423200C3E0F6 /* ProjectAdvancedViewController.m in Sources */, DBF290D71FA64A590046D5CE /* ProvisioningDetailsViewController.m in Sources */, E16018F01DEC0BC200E3A377 /* DropboxViewController.m in Sources */, diff --git a/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme b/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme index 5e1e9e34..40359aaa 100644 --- a/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme +++ b/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme @@ -42,7 +42,7 @@ - -@interface NSImage (Image) - -+(NSImage *)imageWithCGImage:(CGImageRef)cgImage; - -@end diff --git a/AppBox/Common/Extensions/NSImage+Image.m b/AppBox/Common/Extensions/NSImage+Image.m deleted file mode 100644 index 56c25fcb..00000000 --- a/AppBox/Common/Extensions/NSImage+Image.m +++ /dev/null @@ -1,26 +0,0 @@ -// -// NSImage+Image.m -// AppBox -// -// Created by Vineet Choudhary on 18/04/18. -// Copyright © 2018 Developer Insider. All rights reserved. -// - -#import "NSImage+Image.h" - -@implementation NSImage (Image) - -+(NSImage *)imageWithCGImage:(CGImageRef)cgImage{ - static NSLock *imageLock = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - imageLock = [[NSLock alloc] init]; - }); - NSImage *image; - [imageLock lock]; - image = [[NSImage alloc] initWithCGImage:cgImage size:NSMakeSize(250, 250)]; - [imageLock unlock]; - return image; -} - -@end diff --git a/AppBox/ViewController/QRCodeViewController/QRCodeViewController.h b/AppBox/ViewController/QRCodeViewController/QRCodeViewController.h index bce82ea4..cb33a23e 100644 --- a/AppBox/ViewController/QRCodeViewController/QRCodeViewController.h +++ b/AppBox/ViewController/QRCodeViewController/QRCodeViewController.h @@ -10,7 +10,7 @@ #import @interface QRCodeViewController : NSViewController{ - IBOutlet NSImageView *imageViewQRCode; + __weak IBOutlet NSImageView *imageViewQRCode; } @property(nonatomic, strong) XCProject *project; diff --git a/AppBox/ViewController/QRCodeViewController/QRCodeViewController.m b/AppBox/ViewController/QRCodeViewController/QRCodeViewController.m index debbd22b..e8025863 100644 --- a/AppBox/ViewController/QRCodeViewController/QRCodeViewController.m +++ b/AppBox/ViewController/QRCodeViewController/QRCodeViewController.m @@ -8,7 +8,9 @@ #import "QRCodeViewController.h" -@implementation QRCodeViewController +@implementation QRCodeViewController{ + CGImageRef qrCodeImage; +} - (void)viewDidLoad { [super viewDidLoad]; @@ -28,8 +30,12 @@ - (void)viewDidLoad { ZXMultiFormatWriter *writer = [ZXMultiFormatWriter writer]; ZXBitMatrix *result = [writer encode:url format:kBarcodeFormatQRCode width:250 height:250 error:&error]; if (result){ - CGImageRef qrCodeImage = [[ZXImage imageWithMatrix:result] cgimage]; - [imageViewQRCode setImage:[NSImage imageWithCGImage:qrCodeImage]]; + qrCodeImage = [[ZXImage imageWithMatrix:result] cgimage]; + if (qrCodeImage) { + NSImage *image = [[NSImage alloc] initWithCGImage:qrCodeImage size:NSMakeSize(250, 250)]; + [imageViewQRCode setImage:image]; + CGImageRelease(qrCodeImage); + } }else{ [Common showAlertWithTitle:@"Error" andMessage:error.localizedDescription]; } From 8e0eb0010a2a38f7c0deb2dc6fe2f8b2e5ea744a Mon Sep 17 00:00:00 2001 From: Vineet Choudhary Date: Thu, 19 Apr 2018 18:49:11 +0530 Subject: [PATCH 3/3] Fixed QR code crash in release mode --- AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme | 2 +- .../QRCodeViewController/QRCodeViewController.m | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme b/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme index 40359aaa..5e1e9e34 100644 --- a/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme +++ b/AppBox.xcodeproj/xcshareddata/xcschemes/AppBox.xcscheme @@ -42,7 +42,7 @@