Permalink
Browse files

ARC

  • Loading branch information...
1 parent 66396c7 commit c893cb4e7db579a0458e18f955b2e7865f6dd80a @soffes soffes committed May 8, 2012
@@ -109,7 +109,6 @@
B24E9E80121DC29A0085F81E /* UIViewController+SSToolkitAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E42121DC29A0085F81E /* UIViewController+SSToolkitAdditions.m */; };
B25C8E601394327000DE7BFF /* SSCollectionViewExtremityTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = B2B456FC139078B80060C279 /* SSCollectionViewExtremityTableViewCell.m */; };
B25C8E611394327000DE7BFF /* SSCollectionViewExtremityTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = B2B456FB139078B80060C279 /* SSCollectionViewExtremityTableViewCell.h */; };
- B26679B4151BB5D000BFDF6E /* SSConcurrentOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = B24E9E11121DC29A0085F81E /* SSConcurrentOperation.m */; };
B267D3451226CE0400B66519 /* SSCollectionViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B267D3431226CE0400B66519 /* SSCollectionViewController.h */; };
B267D3461226CE0400B66519 /* SSCollectionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B267D3441226CE0400B66519 /* SSCollectionViewController.m */; };
B2721BA0132F136C00D762FD /* SSCollectionViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = B2721B9F132F136C00D762FD /* SSCollectionViewInternal.h */; };
@@ -957,7 +956,6 @@
B2136B3D13ABCC0C00FEBCFD /* SSBorderedView.m in Sources */,
B280E25D13BA769C00FCDA5C /* SSAnimatedImageView.m in Sources */,
B229B469144CE2F500F71626 /* SSCollectionViewTableView.m in Sources */,
- B24F7ACA146B2CB7003255E2 /* SSManagedOperationQueue.m in Sources */,
9EB278B114BBC4360077194C /* SSConcurrentOperation.m in Sources */,
B2C50815151BAB4000E94614 /* NSBundle+SSToolkitAdditions.m in Sources */,
B2F72A141534D54C00556B66 /* SSRateLimit.m in Sources */,
@@ -1010,6 +1008,7 @@
armv6,
armv7,
);
+ CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
DSTROOT = /tmp/SSToolkit.dst;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
@@ -1056,6 +1055,7 @@
armv6,
armv7,
);
+ CLANG_ENABLE_OBJC_ARC = YES;
DSTROOT = /tmp/SSToolkit.dst;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
GCC_MODEL_TUNING = G5;
@@ -41,13 +41,12 @@ - (NSArray *)shuffledArray {
[copy removeObjectAtIndex:index];
}
- [copy release];
return array;
}
- (NSMutableArray *)deepMutableCopy {
- return (NSMutableArray *)CFPropertyListCreateDeepCopy(kCFAllocatorDefault, (CFArrayRef)self, kCFPropertyListMutableContainers);
+ return (__bridge_transfer NSMutableArray *)CFPropertyListCreateDeepCopy(kCFAllocatorDefault, (__bridge CFArrayRef)self, kCFPropertyListMutableContainers);
}
@@ -38,7 +38,7 @@ - (NSString *)MD5Sum {
for (i = 0; i < CC_MD5_DIGEST_LENGTH; i++) {
[ms appendFormat: @"%02x", (int)(digest[i])];
}
- return [[ms copy] autorelease];
+ return [ms copy];
}
- (NSString *)SHA1Sum {
@@ -77,7 +77,7 @@ - (NSString *)base64EncodedString {
output[index + 3] = (i + 2) < length ? _base64EncodingTable[(value >> 0) & 0x3F] : '=';
}
- return [[[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding] autorelease];
+ return [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
}
@@ -64,7 +64,7 @@ - (NSString *)stringWithFormEncodedComponents {
- (NSMutableDictionary *)deepMutableCopy {
- return (NSMutableDictionary *)CFPropertyListCreateDeepCopy(kCFAllocatorDefault, (CFDictionaryRef)self, kCFPropertyListMutableContainers);
+ return (__bridge_transfer NSMutableDictionary *)CFPropertyListCreateDeepCopy(kCFAllocatorDefault, (__bridge CFDictionaryRef)self, kCFPropertyListMutableContainers);
}
@@ -51,14 +51,10 @@ - (NSComparisonResult)compareToVersionString:(NSString *)version {
for (NSUInteger i = 0; i < [leftFields count]; i++) {
NSComparisonResult result = [[leftFields objectAtIndex:i] compare:[rightFields objectAtIndex:i] options:NSNumericSearch];
if (result != NSOrderedSame) {
- [leftFields release];
- [rightFields release];
return result;
}
}
- [leftFields release];
- [rightFields release];
return NSOrderedSame;
}
@@ -110,7 +106,7 @@ - (NSString *)escapeHTML {
- (NSString *)unescapeHTML {
NSMutableString *s = [NSMutableString string];
- NSMutableString *target = [[self mutableCopy] autorelease];
+ NSMutableString *target = [self mutableCopy];
NSCharacterSet *chs = [NSCharacterSet characterSetWithCharactersInString:@"&"];
while ([target length] > 0) {
@@ -161,11 +157,11 @@ - (NSString *)stringByEscapingForURLQuery {
static CFStringRef leaveAlone = CFSTR(" ");
static CFStringRef toEscape = CFSTR("\n\r:/=,!$&'()*+;[]@#?%");
- CFStringRef escapedStr = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)self, leaveAlone,
+ CFStringRef escapedStr = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)self, leaveAlone,
toEscape, kCFStringEncodingUTF8);
if (escapedStr) {
- NSMutableString *mutable = [NSMutableString stringWithString:(NSString *)escapedStr];
+ NSMutableString *mutable = [NSMutableString stringWithString:(__bridge NSString *)escapedStr];
CFRelease(escapedStr);
[mutable replaceOccurrencesOfString:@" " withString:@"+" options:0 range:NSMakeRange(0, [mutable length])];
@@ -185,30 +181,29 @@ - (NSString *)stringByUnescapingFromURLQuery {
- (NSString *)URLEncodedString {
static CFStringRef toEscape = CFSTR(":/=,!$&'()*+;[]@#?%");
- return [(NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
- (CFStringRef)self,
- NULL,
- toEscape,
- kCFStringEncodingUTF8) autorelease];
+ return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
+ (__bridge CFStringRef)self,
+ NULL,
+ toEscape,
+ kCFStringEncodingUTF8);
}
- (NSString *)URLEncodedParameterString {
static CFStringRef toEscape = CFSTR(":/=,!$&'()*+;[]@#?");
- NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
- (CFStringRef)self,
- NULL,
- toEscape,
- kCFStringEncodingUTF8);
- return [result autorelease];
+ return (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
+ (__bridge CFStringRef)self,
+ NULL,
+ toEscape,
+ kCFStringEncodingUTF8);
}
- (NSString *)URLDecodedString {
- return [(NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault,
- (CFStringRef)self,
- CFSTR(""),
- kCFStringEncodingUTF8) autorelease];
+ return (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault,
+ (__bridge CFStringRef)self,
+ CFSTR(""),
+ kCFStringEncodingUTF8);
}
@@ -224,8 +219,7 @@ - (NSString *)base64EncodedString {
+ (NSString *)stringWithBase64String:(NSString *)base64String {
- return [[[NSString alloc] initWithData:[NSData dataWithBase64String:base64String] encoding:NSUTF8StringEncoding]
- autorelease];
+ return [[NSString alloc] initWithData:[NSData dataWithBase64String:base64String] encoding:NSUTF8StringEncoding];
}
@@ -236,7 +230,7 @@ + (NSString *)stringWithUUID {
CFUUIDRef uuid = CFUUIDCreate(NULL);
CFStringRef string = CFUUIDCreateString(NULL, uuid);
CFRelease(uuid);
- return [(NSString *)string autorelease];
+ return (__bridge_transfer NSString *)string;
}
@@ -17,10 +17,7 @@ + (id)URLWithFormat:(NSString *)format, ... {
NSString *string = [[NSString alloc] initWithFormat:format arguments:arguments];
va_end(arguments);
- NSURL *url = [NSURL URLWithString:string];
- [string release];
-
- return url;
+ return [NSURL URLWithString:string];
}
@@ -42,8 +42,6 @@ - (void)setLoading:(BOOL)isLoading {
- (void)dealloc {
self.reloadButton = nil;
self.stopButton = nil;
- [_textFieldBackgroundView release];
- [super dealloc];
}
@@ -42,14 +42,6 @@ - (void)setLoading:(BOOL)isLoading {
}
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_innerView release];
- [super dealloc];
-}
-
-
#pragma mark - UIView
- (id)initWithFrame:(CGRect)aFrame {
@@ -25,7 +25,6 @@ - (CAKeyframeAnimation *)_animationWithName:(NSString *)animationName images:(NS
}];
animation.values = values;
- [values release];
if (delegate) {
animation.delegate = self;
@@ -81,9 +80,7 @@ - (void)startTimedImageAnimation:(NSString *)animationName images:(NSArray *)ima
[keyTimesAsPercent addObject:[NSNumber numberWithFloat:1.0f]];
- animation.keyTimes = keyTimesAsPercent;
- [keyTimesAsPercent release];
-
+ animation.keyTimes = keyTimesAsPercent;
animation.duration = totalDuration;
}
@@ -16,14 +16,6 @@ @implementation SSBadgeTableViewCell
@synthesize badgeView = _badgeView;
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_badgeView release];
- [super dealloc];
-}
-
-
#pragma mark - UITableView
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
@@ -29,59 +29,44 @@ @implementation SSBadgeView
@synthesize highlighted = _highlighted;
- (void)setBadgeColor:(UIColor *)badgeColor {
- [badgeColor retain];
- [_badgeColor release];
_badgeColor = badgeColor;
-
[self setNeedsDisplay];
}
- (void)setHighlightedBadgeColor:(UIColor *)highlightedBadgeColor {
- [highlightedBadgeColor retain];
- [_highlightedBadgeColor release];
_highlightedBadgeColor = highlightedBadgeColor;
-
[self setNeedsDisplay];
}
- (void)setBadgeImage:(UIImage *)badgeImage {
- [badgeImage retain];
- [_badgeImage release];
- _badgeImage = badgeImage;
-
+ _badgeImage = badgeImage;
[self setNeedsDisplay];
}
- (void)setHighlightedBadgeImage:(UIImage *)highlightedBadgeImage {
- [highlightedBadgeImage retain];
- [_highlightedBadgeImage release];
- _highlightedBadgeImage = highlightedBadgeImage;
-
+ _highlightedBadgeImage = highlightedBadgeImage;
[self setNeedsDisplay];
}
- (void)setCornerRadius:(CGFloat)cornerRadius {
_cornerRadius = cornerRadius;
-
[self setNeedsDisplay];
}
- (void)setBadgeAlignment:(SSBadgeViewAlignment)badgeAlignment {
_badgeAlignment = badgeAlignment;
-
[self setNeedsDisplay];
}
- (void)setHighlighted:(BOOL)highlighted {
_highlighted = highlighted;
_textLabel.highlighted = highlighted;
-
[self setNeedsDisplay];
}
@@ -93,18 +78,6 @@ + (UIColor *)defaultBadgeColor {
}
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_textLabel release];
- [_badgeColor release];
- [_highlightedBadgeColor release];
- [_badgeImage release];
- [_highlightedBadgeImage release];
- [super dealloc];
-}
-
-
#pragma mark - UIView
- (id)initWithCoder:(NSCoder *)aDecoder {
@@ -20,52 +20,29 @@ @implementation SSBorderedView
- (void)setTopBorderColor:(UIColor *)topBorderColor {
- [topBorderColor retain];
- [_topBorderColor release];
_topBorderColor = topBorderColor;
-
[self setNeedsDisplay];
}
- (void)setTopInsetColor:(UIColor *)topInsetColor {
- [topInsetColor retain];
- [_topInsetColor release];
_topInsetColor = topInsetColor;
-
[self setNeedsDisplay];
}
- (void)setBottomInsetColor:(UIColor *)bottomInsetColor {
- [bottomInsetColor retain];
- [_bottomInsetColor release];
- _bottomInsetColor = bottomInsetColor;
-
+ _bottomInsetColor = bottomInsetColor;
[self setNeedsDisplay];
}
- (void)setBottomBorderColor:(UIColor *)bottomBorderColor {
- [bottomBorderColor retain];
- [_bottomBorderColor release];
- _bottomBorderColor = bottomBorderColor;
-
+ _bottomBorderColor = bottomBorderColor;
[self setNeedsDisplay];
}
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_topBorderColor release];
- [_topInsetColor release];
- [_bottomInsetColor release];
- [_bottomBorderColor release];
- [super dealloc];
-}
-
-
#pragma mark - UIView
- (void)drawRect:(CGRect)rect {
Oops, something went wrong.

0 comments on commit c893cb4

Please sign in to comment.