Skip to content

Commit ac643b7

Browse files
committed
Convert to ARC
Signed-off-by: onevcat <onevcat@gmail.com>
1 parent be73133 commit ac643b7

6 files changed

Lines changed: 20 additions & 16 deletions

File tree

VVDocumenter-Xcode.xcodeproj/project.pbxproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,12 @@
538538
D1438106179551B900C829CE /* Debug */ = {
539539
isa = XCBuildConfiguration;
540540
buildSettings = {
541+
CLANG_ENABLE_OBJC_ARC = YES;
541542
COMBINE_HIDPI_IMAGES = YES;
542543
DEPLOYMENT_LOCATION = YES;
543544
DSTROOT = "${HOME}";
544545
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
545-
GCC_ENABLE_OBJC_GC = supported;
546+
GCC_ENABLE_OBJC_GC = unsupported;
546547
GCC_PRECOMPILE_PREFIX_HEADER = YES;
547548
GCC_PREFIX_HEADER = "VVDocumenter-Xcode/VVDocumenter-Xcode-Prefix.pch";
548549
INFOPLIST_FILE = "VVDocumenter-Xcode/VVDocumenter-Xcode-Info.plist";
@@ -555,11 +556,12 @@
555556
D1438107179551B900C829CE /* Release */ = {
556557
isa = XCBuildConfiguration;
557558
buildSettings = {
559+
CLANG_ENABLE_OBJC_ARC = YES;
558560
COMBINE_HIDPI_IMAGES = YES;
559561
DEPLOYMENT_LOCATION = YES;
560562
DSTROOT = "${HOME}";
561563
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
562-
GCC_ENABLE_OBJC_GC = supported;
564+
GCC_ENABLE_OBJC_GC = unsupported;
563565
GCC_PRECOMPILE_PREFIX_HEADER = YES;
564566
GCC_PREFIX_HEADER = "VVDocumenter-Xcode/VVDocumenter-Xcode-Prefix.pch";
565567
INFOPLIST_FILE = "VVDocumenter-Xcode/VVDocumenter-Xcode-Info.plist";
@@ -572,6 +574,7 @@
572574
D1C462E817999C2000EB7B23 /* Debug */ = {
573575
isa = XCBuildConfiguration;
574576
buildSettings = {
577+
CLANG_ENABLE_OBJC_ARC = YES;
575578
COMBINE_HIDPI_IMAGES = YES;
576579
FRAMEWORK_SEARCH_PATHS = (
577580
"$(DEVELOPER_DIR)/../SharedFrameworks",
@@ -589,6 +592,7 @@
589592
D1C462E917999C2000EB7B23 /* Release */ = {
590593
isa = XCBuildConfiguration;
591594
buildSettings = {
595+
CLANG_ENABLE_OBJC_ARC = YES;
592596
COMBINE_HIDPI_IMAGES = YES;
593597
FRAMEWORK_SEARCH_PATHS = (
594598
"$(DEVELOPER_DIR)/../SharedFrameworks",

VVDocumenter-Xcode/Commenter/VVBaseCommenter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@property (nonatomic, copy) NSString *indent;
1414
@property (nonatomic, copy) NSString *code;
15-
@property (nonatomic, retain) NSMutableArray *arguments;
15+
@property (nonatomic, strong) NSMutableArray *arguments;
1616
@property (nonatomic, assign) BOOL hasReturn;
1717

1818
-(id) initWithIndentString:(NSString *)indent codeString:(NSString *)code;

VVDocumenter-Xcode/Commenter/VVBaseCommenter.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ -(void) parseArguments
9494
if (braceGroups.count > 0) {
9595
NSString *argumentGroupString = braceGroups[0];
9696
NSArray *argumentStrings = [argumentGroupString componentsSeparatedByString:@","];
97-
for (NSString *argumentString in argumentStrings) {
97+
for (__strong NSString *argumentString in argumentStrings) {
9898
VVArgument *arg = [[VVArgument alloc] init];
9999
argumentString = [argumentString vv_stringByReplacingRegexPattern:@"\\s+$" withString:@""];
100100
argumentString = [argumentString vv_stringByReplacingRegexPattern:@"\\s+" withString:@" "];

VVDocumenter-Xcode/Setting/VVDSettingPanelWindowController.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
#import "VVDocumenterSetting.h"
1111

1212
@interface VVDSettingPanelWindowController ()<NSTextFieldDelegate>
13-
@property (assign) IBOutlet NSTextField *tfTrigger;
14-
@property (assign) IBOutlet NSButton *btnUseSpaces;
15-
@property (assign) IBOutlet NSTextField *tfSpaceCount;
16-
@property (assign) IBOutlet NSTextField *tfSpaceLabel;
13+
@property (weak) IBOutlet NSTextField *tfTrigger;
14+
@property (weak) IBOutlet NSButton *btnUseSpaces;
15+
@property (weak) IBOutlet NSTextField *tfSpaceCount;
16+
@property (weak) IBOutlet NSTextField *tfSpaceLabel;
1717

18-
@property (assign) IBOutlet NSStepper *stepperCount;
18+
@property (weak) IBOutlet NSStepper *stepperCount;
1919

20-
@property (assign) IBOutlet NSButton *btnPrefixWithStar;
20+
@property (weak) IBOutlet NSButton *btnPrefixWithStar;
2121

2222
@end
2323

VVDocumenter-Xcode/VVDocumenterManager.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
#import "VVDocumenterSetting.h"
1616

1717
@interface VVDocumenterManager()
18-
@property (nonatomic, retain) id eventMonitor;
18+
@property (nonatomic, strong) id eventMonitor;
1919
@property (nonatomic, assign) BOOL prefixTyped;
20+
@property (nonatomic, strong) VVDSettingPanelWindowController *settingPanel;
2021
@end
2122

2223
@implementation VVDocumenterManager
@@ -62,13 +63,12 @@ -(void) addSettingMenu
6263

6364
[newMenuItem setTarget:self];
6465
[[editMenuItem submenu] addItem:newMenuItem];
65-
[newMenuItem release];
6666
}
6767
}
6868

6969
-(void) showSettingPanle:(NSNotification *)noti {
70-
VVDSettingPanelWindowController *panelController = [[VVDSettingPanelWindowController alloc] initWithWindowNibName:@"VVDSettingPanelWindowController"];
71-
[panelController showWindow:panelController];
70+
self.settingPanel = [[VVDSettingPanelWindowController alloc] initWithWindowNibName:@"VVDSettingPanelWindowController"];
71+
[self.settingPanel showWindow:self.settingPanel];
7272
}
7373

7474
- (void) textStorageDidChange:(NSNotification *)noti {

VVDocumenterTests/SyntaxTests/SyntaxTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
@interface SyntaxTests()
1414

15-
@property (nonatomic, retain) NSArray* inputs;
16-
@property (nonatomic, retain) NSArray* corrects;
15+
@property (nonatomic, strong) NSArray* inputs;
16+
@property (nonatomic, strong) NSArray* corrects;
1717

1818
@end
1919

0 commit comments

Comments
 (0)