iut 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +5 -0
- data/Rakefile +3 -0
- data/iut.gemspec +1 -1
- data/lib/iut/arc.rb +125 -0
- data/lib/iut/generator.rb +1 -1
- data/lib/iut/template_version.rb +1 -1
- data/lib/iut/version.rb +2 -2
- data/lib/iut.rb +32 -7
- data/test/files/IUTTest/IUTTest/AppDelegate.h +15 -0
- data/test/files/IUTTest/IUTTest/AppDelegate.m +69 -0
- data/test/files/IUTTest/IUTTest/Arc.h +13 -0
- data/test/files/IUTTest/IUTTest/Arc.m +13 -0
- data/test/files/IUTTest/IUTTest/ArcWithRetainInComment.h +17 -0
- data/test/files/IUTTest/IUTTest/ArcWithRetainInComment.m +28 -0
- data/test/files/IUTTest/IUTTest/IUTTest-Info.plist +40 -0
- data/test/files/IUTTest/IUTTest/IUTTest-Prefix.pch +14 -0
- data/test/files/IUTTest/IUTTest/LooksArcButSuperDoesNotUse.h +14 -0
- data/test/files/IUTTest/IUTTest/LooksArcButSuperDoesNotUse.m +13 -0
- data/test/files/IUTTest/IUTTest/NonArcCaseDealloc.h +13 -0
- data/test/files/IUTTest/IUTTest/NonArcCaseDealloc.m +18 -0
- data/test/files/IUTTest/IUTTest/NonArcWithAutoreleaseInMethod.h +13 -0
- data/test/files/IUTTest/IUTTest/NonArcWithAutoreleaseInMethod.m +18 -0
- data/test/files/IUTTest/IUTTest/NonArcWithPropertyCopy.h +15 -0
- data/test/files/IUTTest/IUTTest/NonArcWithPropertyCopy.m +15 -0
- data/test/files/IUTTest/IUTTest/NonArcWithPropertyRetain.h +15 -0
- data/test/files/IUTTest/IUTTest/NonArcWithPropertyRetain.m +15 -0
- data/test/files/IUTTest/IUTTest/NonArcWithReleaseInMethod.h +13 -0
- data/test/files/IUTTest/IUTTest/NonArcWithReleaseInMethod.m +19 -0
- data/test/files/IUTTest/IUTTest/en.lproj/InfoPlist.strings +2 -0
- data/test/files/IUTTest/IUTTest/main.m +18 -0
- data/test/files/IUTTest/IUTTest.xcodeproj/project.pbxproj +311 -0
- data/test/files/IUTTest/IUTTest.xcodeproj/project.pbxproj.expected +313 -0
- data/test/files/IUTTest/IUTTest.xcodeproj/project.pbxproj.org +311 -0
- data/test/test_arc.rb +54 -0
- data/test/test_arc_change_settings.rb +84 -0
- metadata +58 -3
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/iut.gemspec
CHANGED
data/lib/iut/arc.rb
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
# -*- coding:UTF-8 -*-
|
2
|
+
require "fileutils"
|
3
|
+
require "optparse"
|
4
|
+
|
5
|
+
module Iut
|
6
|
+
|
7
|
+
class Arc
|
8
|
+
|
9
|
+
attr_accessor :project_path
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
@project_path = Dir.pwd
|
13
|
+
end
|
14
|
+
|
15
|
+
def nonarc? class_name
|
16
|
+
return false if class_name == "NSObject"
|
17
|
+
|
18
|
+
super_name = "NSObject"
|
19
|
+
|
20
|
+
Dir.chdir self.project_path do
|
21
|
+
Dir.glob("**/#{class_name}\.[hm]") do |f|
|
22
|
+
context = File.read f
|
23
|
+
# remove comments
|
24
|
+
context.gsub! /\/\/.*\n/, ""
|
25
|
+
context.gsub! /\/\*.*\*\//m, ""
|
26
|
+
# remove spaces
|
27
|
+
context.gsub! /\s+/, " "
|
28
|
+
|
29
|
+
case f[-2, 2]
|
30
|
+
when /.h/i
|
31
|
+
# get a name of super class
|
32
|
+
a = context.scan(/@interface.*:\s(\S+)/)
|
33
|
+
super_name = a.first.first if a.first
|
34
|
+
|
35
|
+
case context
|
36
|
+
when /@property\s*\(.*copy(\s*|\]|\))/,
|
37
|
+
/@property\s*\(.*retain(\s*|\]|\))/
|
38
|
+
return true
|
39
|
+
end
|
40
|
+
when /.m/i
|
41
|
+
case context
|
42
|
+
when /\s+dealloc(\s*|\])/, /\s+autorelease(\s*|\])/,
|
43
|
+
/\s+dealloc(\s*|\])/, /\s+release(\s*|\])/
|
44
|
+
return true
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
nonarc? super_name
|
50
|
+
end
|
51
|
+
|
52
|
+
def arc? class_name
|
53
|
+
!self.nonarc? class_name
|
54
|
+
end
|
55
|
+
|
56
|
+
def change_project_settings
|
57
|
+
Dir.chdir self.project_path do
|
58
|
+
Dir.glob("**/project.pbxproj") do |f|
|
59
|
+
lines = []
|
60
|
+
xcbuild_config_section = false
|
61
|
+
|
62
|
+
# backup
|
63
|
+
FileUtils.cp f, "#{f}.#{ Time.now.strftime('%Y%m%d-%H%M%S') }"
|
64
|
+
|
65
|
+
context = File.read f
|
66
|
+
seted_arc_project_setting = /CLANG_ENABLE_OBJC_ARC/ =~ context
|
67
|
+
context.each_line do |l|
|
68
|
+
case l
|
69
|
+
when /Begin XCBuildConfiguration section/
|
70
|
+
xcbuild_config_section = true
|
71
|
+
when /End PBXBuildFile section/
|
72
|
+
xcbuild_config_section = false
|
73
|
+
when /ARCHS/
|
74
|
+
unless seted_arc_project_setting
|
75
|
+
l << "\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n" if xcbuild_config_section
|
76
|
+
end
|
77
|
+
when /(\S+)\.m.+in Sources.*isa = PBXBuildFile/i
|
78
|
+
class_name = $1
|
79
|
+
unless /settings/ =~ l
|
80
|
+
if nonarc? class_name
|
81
|
+
l.gsub!("};\n", "settings = {COMPILER_FLAGS = \"-fno-objc-arc\"; }; };\n")
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
lines << l
|
86
|
+
end
|
87
|
+
File.open(f, "w") do |f|
|
88
|
+
f.write lines.join
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def revert
|
95
|
+
Dir.chdir self.project_path do
|
96
|
+
files = []
|
97
|
+
Dir.glob("**/project.pbxproj.*") do |f|
|
98
|
+
files << f if /project.pbxproj.\d{8}\-\d{6}/ =~ f
|
99
|
+
end
|
100
|
+
unless files.size == 0
|
101
|
+
FileUtils.cp files.sort.reverse.first, Dir.glob("**/project.pbxproj").first
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.parse
|
107
|
+
opt = OptionParser.new
|
108
|
+
options = {}
|
109
|
+
opt.on('-p', '--project PROJECT', 'Set project path PROJECT.') {|v| options[:PROJECT] = v }
|
110
|
+
opt.parse!(ARGV)
|
111
|
+
|
112
|
+
arc = self.new
|
113
|
+
arc.project_path = options[:PROJECT] if options[:PROJECT]
|
114
|
+
|
115
|
+
case ARGV[1]
|
116
|
+
when /revert/
|
117
|
+
arc.revert
|
118
|
+
else
|
119
|
+
arc.change_project_settings
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
end
|
124
|
+
|
125
|
+
end
|
data/lib/iut/generator.rb
CHANGED
data/lib/iut/template_version.rb
CHANGED
data/lib/iut/version.rb
CHANGED
data/lib/iut.rb
CHANGED
@@ -1,21 +1,46 @@
|
|
1
|
-
# -*-
|
1
|
+
# -*- coding:UTF-8 -*-
|
2
2
|
$:.unshift(File.expand_path(File.dirname(__FILE__))) unless
|
3
3
|
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
4
4
|
|
5
5
|
require "iut/version"
|
6
6
|
require "iut/template_version"
|
7
7
|
require "iut/generator"
|
8
|
+
require "iut/arc"
|
8
9
|
|
9
10
|
Version = "#{Iut::VERSION} (template #{Iut::TEMPLATE_VERSION})"
|
10
11
|
|
11
12
|
opt = OptionParser.new
|
12
|
-
opt.
|
13
|
+
opt.on('-p', '--project PROJECT', 'Set project path PROJECT.') {|v| v }
|
14
|
+
|
15
|
+
opt.banner = <<EOF
|
16
|
+
Usage: iut [command] [subcommand] [options] [TEST_PROJECT_NAME]
|
17
|
+
|
18
|
+
Commands are:
|
19
|
+
Nothing command, makes a empty project of iUnitTest.
|
20
|
+
The project name is specified by TEST_PROJECT_NAME.
|
21
|
+
arc Set a compile flag to use ARC. And scanned all files.
|
22
|
+
If a class doesn't use ARC, set a compile flag
|
23
|
+
-fno-objc-arc to the class.
|
24
|
+
arc revert Revert a previous arc command
|
25
|
+
|
26
|
+
ex)
|
27
|
+
$ iut TestProject It makes iUnitTest's empty project TestProject.
|
28
|
+
$ iut arc Set a compile flag to use ARC.
|
29
|
+
$ iut arc revert Revert a previous arc command.
|
30
|
+
|
31
|
+
EOF
|
32
|
+
|
13
33
|
#opt.on('-h', '--help', 'show this help message and exit') {|v| }
|
14
|
-
opt.parse
|
34
|
+
argv = opt.parse(ARGV)
|
15
35
|
|
16
|
-
if
|
17
|
-
|
18
|
-
opt.parse
|
36
|
+
if argv.size == 0
|
37
|
+
argv.unshift "--help"
|
38
|
+
argv = opt.parse(argv)
|
19
39
|
end
|
20
40
|
|
21
|
-
|
41
|
+
case argv[0]
|
42
|
+
when /arc/
|
43
|
+
Iut::Arc.parse
|
44
|
+
else
|
45
|
+
Iut::Generator::Project.generate
|
46
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
//
|
2
|
+
// AppDelegate.h
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <UIKit/UIKit.h>
|
10
|
+
|
11
|
+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
12
|
+
|
13
|
+
@property (strong, nonatomic) UIWindow *window;
|
14
|
+
|
15
|
+
@end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
//
|
2
|
+
// AppDelegate.m
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "AppDelegate.h"
|
10
|
+
|
11
|
+
@implementation AppDelegate
|
12
|
+
|
13
|
+
@synthesize window = _window;
|
14
|
+
|
15
|
+
- (void)dealloc
|
16
|
+
{
|
17
|
+
[_window release];
|
18
|
+
[super dealloc];
|
19
|
+
}
|
20
|
+
|
21
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
22
|
+
{
|
23
|
+
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
|
24
|
+
// Override point for customization after application launch.
|
25
|
+
self.window.backgroundColor = [UIColor whiteColor];
|
26
|
+
[self.window makeKeyAndVisible];
|
27
|
+
return YES;
|
28
|
+
}
|
29
|
+
|
30
|
+
- (void)applicationWillResignActive:(UIApplication *)application
|
31
|
+
{
|
32
|
+
/*
|
33
|
+
Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
34
|
+
Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
35
|
+
*/
|
36
|
+
}
|
37
|
+
|
38
|
+
- (void)applicationDidEnterBackground:(UIApplication *)application
|
39
|
+
{
|
40
|
+
/*
|
41
|
+
Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
42
|
+
If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
43
|
+
*/
|
44
|
+
}
|
45
|
+
|
46
|
+
- (void)applicationWillEnterForeground:(UIApplication *)application
|
47
|
+
{
|
48
|
+
/*
|
49
|
+
Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
50
|
+
*/
|
51
|
+
}
|
52
|
+
|
53
|
+
- (void)applicationDidBecomeActive:(UIApplication *)application
|
54
|
+
{
|
55
|
+
/*
|
56
|
+
Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
57
|
+
*/
|
58
|
+
}
|
59
|
+
|
60
|
+
- (void)applicationWillTerminate:(UIApplication *)application
|
61
|
+
{
|
62
|
+
/*
|
63
|
+
Called when the application is about to terminate.
|
64
|
+
Save data if appropriate.
|
65
|
+
See also applicationDidEnterBackground:.
|
66
|
+
*/
|
67
|
+
}
|
68
|
+
|
69
|
+
@end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
//
|
2
|
+
// ArcWithRetainInComment.h
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
|
11
|
+
@interface ArcWithRetainInComment : NSObject
|
12
|
+
|
13
|
+
// @property (retain, nonatomic) NSString *foo;
|
14
|
+
|
15
|
+
/* @property (retain, nonatomic) NSString *bar; */
|
16
|
+
|
17
|
+
@end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
//
|
2
|
+
// ArcWithRetainInComment.m
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "ArcWithRetainInComment.h"
|
10
|
+
|
11
|
+
@implementation ArcWithRetainInComment
|
12
|
+
|
13
|
+
/*
|
14
|
+
- (void)foo
|
15
|
+
{
|
16
|
+
NSArray *array = [NSArray new];
|
17
|
+
[array release];
|
18
|
+
}
|
19
|
+
*/
|
20
|
+
|
21
|
+
|
22
|
+
//- (void)bar
|
23
|
+
//{
|
24
|
+
// NSArray *array = [NSArray new];
|
25
|
+
// [array release];
|
26
|
+
//}
|
27
|
+
|
28
|
+
@end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
6
|
+
<string>en</string>
|
7
|
+
<key>CFBundleDisplayName</key>
|
8
|
+
<string>${PRODUCT_NAME}</string>
|
9
|
+
<key>CFBundleExecutable</key>
|
10
|
+
<string>${EXECUTABLE_NAME}</string>
|
11
|
+
<key>CFBundleIconFiles</key>
|
12
|
+
<array/>
|
13
|
+
<key>CFBundleIdentifier</key>
|
14
|
+
<string>foo.bar.${PRODUCT_NAME:rfc1034identifier}</string>
|
15
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
16
|
+
<string>6.0</string>
|
17
|
+
<key>CFBundleName</key>
|
18
|
+
<string>${PRODUCT_NAME}</string>
|
19
|
+
<key>CFBundlePackageType</key>
|
20
|
+
<string>APPL</string>
|
21
|
+
<key>CFBundleShortVersionString</key>
|
22
|
+
<string>1.0</string>
|
23
|
+
<key>CFBundleSignature</key>
|
24
|
+
<string>????</string>
|
25
|
+
<key>CFBundleVersion</key>
|
26
|
+
<string>1.0</string>
|
27
|
+
<key>LSRequiresIPhoneOS</key>
|
28
|
+
<true/>
|
29
|
+
<key>UIRequiredDeviceCapabilities</key>
|
30
|
+
<array>
|
31
|
+
<string>armv7</string>
|
32
|
+
</array>
|
33
|
+
<key>UISupportedInterfaceOrientations</key>
|
34
|
+
<array>
|
35
|
+
<string>UIInterfaceOrientationPortrait</string>
|
36
|
+
<string>UIInterfaceOrientationLandscapeLeft</string>
|
37
|
+
<string>UIInterfaceOrientationLandscapeRight</string>
|
38
|
+
</array>
|
39
|
+
</dict>
|
40
|
+
</plist>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
//
|
2
|
+
// Prefix header for all source files of the 'IUTTest' target in the 'IUTTest' project
|
3
|
+
//
|
4
|
+
|
5
|
+
#import <Availability.h>
|
6
|
+
|
7
|
+
#ifndef __IPHONE_3_0
|
8
|
+
#warning "This project uses features only available in iOS SDK 3.0 and later."
|
9
|
+
#endif
|
10
|
+
|
11
|
+
#ifdef __OBJC__
|
12
|
+
#import <UIKit/UIKit.h>
|
13
|
+
#import <Foundation/Foundation.h>
|
14
|
+
#endif
|
@@ -0,0 +1,14 @@
|
|
1
|
+
//
|
2
|
+
// LooksArcButSuperDoesNotUse.h
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/03/01.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
#import "NonArcCaseDealloc.h"
|
11
|
+
|
12
|
+
@interface LooksArcButSuperDoesNotUse : NonArcCaseDealloc
|
13
|
+
|
14
|
+
@end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//
|
2
|
+
// LooksArcButSuperDoesNotUse.m
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/03/01.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "LooksArcButSuperDoesNotUse.h"
|
10
|
+
|
11
|
+
@implementation LooksArcButSuperDoesNotUse
|
12
|
+
|
13
|
+
@end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
//
|
2
|
+
// NoUseArc.m
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "NonArcCaseDealloc.h"
|
10
|
+
|
11
|
+
@implementation NonArcCaseDealloc
|
12
|
+
|
13
|
+
- (void)dealloc
|
14
|
+
{
|
15
|
+
[super dealloc];
|
16
|
+
}
|
17
|
+
|
18
|
+
@end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//
|
2
|
+
// NonArcWithRetainInMethod.h
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
|
11
|
+
@interface NonArcWithAutoreleaseInMethod : NSObject
|
12
|
+
|
13
|
+
@end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
//
|
2
|
+
// NonArcWithRetainInMethod.m
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "NonArcWithAutoreleaseInMethod.h"
|
10
|
+
|
11
|
+
@implementation NonArcWithAutoreleaseInMethod
|
12
|
+
|
13
|
+
- (void)foo
|
14
|
+
{
|
15
|
+
NSArray *array = [[NSArray new] autorelease];
|
16
|
+
}
|
17
|
+
|
18
|
+
@end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
//
|
2
|
+
// NonArcWithProperty.h
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
|
11
|
+
@interface NonArcWithPropertyCopy : NSObject
|
12
|
+
|
13
|
+
@property (copy, nonatomic) NSString *foo;
|
14
|
+
|
15
|
+
@end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
//
|
2
|
+
// NonArcWithProperty.m
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "NonArcWithPropertyCopy.h"
|
10
|
+
|
11
|
+
@implementation NonArcWithPropertyCopy
|
12
|
+
|
13
|
+
@synthesize foo = _foo;
|
14
|
+
|
15
|
+
@end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
//
|
2
|
+
// NonArcWithPropertyRetain.h
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
|
11
|
+
@interface NonArcWithPropertyRetain : NSObject
|
12
|
+
|
13
|
+
@property (retain, nonatomic) NSString *foo;
|
14
|
+
|
15
|
+
@end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
//
|
2
|
+
// NonArcWithPropertyRetain.m
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "NonArcWithPropertyRetain.h"
|
10
|
+
|
11
|
+
@implementation NonArcWithPropertyRetain
|
12
|
+
|
13
|
+
@synthesize foo = _foo;
|
14
|
+
|
15
|
+
@end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
//
|
2
|
+
// NonArcWithReleaseInMethod.h
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
|
11
|
+
@interface NonArcWithReleaseInMethod : NSObject
|
12
|
+
|
13
|
+
@end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
//
|
2
|
+
// NonArcWithReleaseInMethod.m
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "NonArcWithReleaseInMethod.h"
|
10
|
+
|
11
|
+
@implementation NonArcWithReleaseInMethod
|
12
|
+
|
13
|
+
- (void)foo
|
14
|
+
{
|
15
|
+
NSArray *array = [NSArray new];
|
16
|
+
[array release];
|
17
|
+
}
|
18
|
+
|
19
|
+
@end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
//
|
2
|
+
// main.m
|
3
|
+
// IUTTest
|
4
|
+
//
|
5
|
+
// Created by Ito Katsuyoshi on 12/02/29.
|
6
|
+
// Copyright (c) 2012年 ITO SOFT DESIGN Inc. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <UIKit/UIKit.h>
|
10
|
+
|
11
|
+
#import "AppDelegate.h"
|
12
|
+
|
13
|
+
int main(int argc, char *argv[])
|
14
|
+
{
|
15
|
+
@autoreleasepool {
|
16
|
+
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
17
|
+
}
|
18
|
+
}
|