Skip to content

Commit e8b2537

Browse files
committed
Convert TweetStream to an ARC-enabled project
1 parent 3a1ccc7 commit e8b2537

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

Examples/TweetStream/TweetStream.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@
340340
isa = XCBuildConfiguration;
341341
buildSettings = {
342342
ALWAYS_SEARCH_USER_PATHS = NO;
343+
CLANG_ENABLE_OBJC_ARC = YES;
343344
COPY_PHASE_STRIP = NO;
344345
FRAMEWORK_SEARCH_PATHS = (
345346
"$(inherited)",
@@ -349,6 +350,7 @@
349350
GCC_DYNAMIC_NO_PIC = NO;
350351
GCC_PRECOMPILE_PREFIX_HEADER = YES;
351352
GCC_PREFIX_HEADER = "TweetStream/TweetStream-Prefix.pch";
353+
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
352354
INFOPLIST_FILE = "TweetStream/TweetStream-Info.plist";
353355
LIBRARY_SEARCH_PATHS = (
354356
"$(inherited)",
@@ -364,6 +366,7 @@
364366
isa = XCBuildConfiguration;
365367
buildSettings = {
366368
ALWAYS_SEARCH_USER_PATHS = NO;
369+
CLANG_ENABLE_OBJC_ARC = YES;
367370
COPY_PHASE_STRIP = YES;
368371
FRAMEWORK_SEARCH_PATHS = (
369372
"$(inherited)",
@@ -372,6 +375,7 @@
372375
);
373376
GCC_PRECOMPILE_PREFIX_HEADER = YES;
374377
GCC_PREFIX_HEADER = "TweetStream/TweetStream-Prefix.pch";
378+
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
375379
INFOPLIST_FILE = "TweetStream/TweetStream-Info.plist";
376380
LIBRARY_SEARCH_PATHS = (
377381
"$(inherited)",

Examples/TweetStream/TweetStream/TweetStreamAppDelegate.m

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,5 @@ - (void)applicationWillTerminate:(UIApplication *)application
6565
*/
6666
}
6767

68-
- (void)dealloc
69-
{
70-
[_window release];
71-
[_viewController release];
72-
[super dealloc];
73-
}
7468

7569
@end

Examples/TweetStream/TweetStream/TweetStreamViewController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
IBOutlet UITextField *password;
1717
IBOutlet UITextView *tweet;
1818

19+
NSURLConnection *theConnection;
1920
SBJsonStreamParser *parser;
2021
SBJsonStreamParserAdapter *adapter;
2122
}

Examples/TweetStream/TweetStream/TweetStreamViewController.m

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ @interface TweetStreamViewController () <SBJsonStreamParserAdapterDelegate>
1414

1515
@implementation TweetStreamViewController
1616

17-
- (void)dealloc
18-
{
19-
[super dealloc];
20-
}
2117

2218
- (void)didReceiveMemoryWarning
2319
{
@@ -77,7 +73,7 @@ - (IBAction)go {
7773
cachePolicy:NSURLRequestUseProtocolCachePolicy
7874
timeoutInterval:60.0];
7975

80-
[[[NSURLConnection alloc] initWithRequest:theRequest delegate:self] autorelease];
76+
theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
8177
}
8278

8379
#pragma mark SBJsonStreamParserAdapterDelegate methods
@@ -130,9 +126,6 @@ - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)err
130126
}
131127

132128
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
133-
[connection release];
134-
[adapter release];
135-
[parser release];
136129
}
137130

138131

Examples/TweetStream/TweetStream/main.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88

99
#import <UIKit/UIKit.h>
1010

11+
#import "TweetStreamAppDelegate.h"
12+
1113
int main(int argc, char *argv[])
1214
{
13-
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
14-
int retVal = UIApplicationMain(argc, argv, nil, nil);
15-
[pool release];
15+
int retVal = 0;
16+
@autoreleasepool {
17+
retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([TweetStreamAppDelegate class]));
18+
}
1619
return retVal;
1720
}

0 commit comments

Comments
 (0)