Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ARC

  • Loading branch information...
commit c893cb4e7db579a0458e18f955b2e7865f6dd80a 1 parent 66396c7
Sam Soffes soffes authored
Showing with 61 additions and 360 deletions.
  1. +2 −2 SSToolkit.xcodeproj/project.pbxproj
  2. +1 −2  SSToolkit/NSArray+SSToolkitAdditions.m
  3. +2 −2 SSToolkit/NSData+SSToolkitAdditions.m
  4. +1 −1  SSToolkit/NSDictionary+SSToolkitAdditions.m
  5. +19 −25 SSToolkit/NSString+SSToolkitAdditions.m
  6. +1 −4 SSToolkit/NSURL+SSToolkitAdditions.m
  7. +0 −2  SSToolkit/SSAddressBarTextField.m
  8. +0 −8 SSToolkit/SSAddressBarTextFieldBackgroundView.m
  9. +1 −4 SSToolkit/SSAnimatedImageView.m
  10. +0 −8 SSToolkit/SSBadgeTableViewCell.m
  11. +2 −29 SSToolkit/SSBadgeView.m
  12. +2 −25 SSToolkit/SSBorderedView.m
  13. +8 −20 SSToolkit/SSCollectionView.m
  14. +0 −2  SSToolkit/SSCollectionViewController.m
  15. +0 −10 SSToolkit/SSCollectionViewExtremityTableViewCell.m
  16. +1 −17 SSToolkit/SSCollectionViewItem.m
  17. +1 −3 SSToolkit/SSCollectionViewItemTableViewCell.m
  18. +1 −2  SSToolkit/SSDrawingUtilities.m
  19. +0 −11 SSToolkit/SSGradientView.m
  20. +2 −8 SSToolkit/SSHUDView.m
  21. +1 −20 SSToolkit/SSLineView.m
  22. +0 −9 SSToolkit/SSLoadingView.m
  23. +1 −9 SSToolkit/SSPickerViewController.m
  24. +0 −20 SSToolkit/SSPieProgressView.m
  25. +1 −19 SSToolkit/SSRatingPicker.m
  26. +0 −12 SSToolkit/SSRatingPickerScrollView.m
  27. +1 −3 SSToolkit/SSRatingPickerViewController.m
  28. +7 −50 SSToolkit/SSSegmentedControl.m
  29. +0 −10 SSToolkit/SSTextField.m
  30. +1 −7 SSToolkit/SSTextView.m
  31. +1 −8 SSToolkit/SSWebView.m
  32. +4 −7 SSToolkit/UIView+SSToolkitAdditions.m
  33. +0 −1  SSToolkit/UIViewController+SSToolkitAdditions.m
4 SSToolkit.xcodeproj/project.pbxproj
View
@@ -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;
3  SSToolkit/NSArray+SSToolkitAdditions.m
View
@@ -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);
}
4 SSToolkit/NSData+SSToolkitAdditions.m
View
@@ -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];
}
2  SSToolkit/NSDictionary+SSToolkitAdditions.m
View
@@ -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);
}
44 SSToolkit/NSString+SSToolkitAdditions.m
View
@@ -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;
}
5 SSToolkit/NSURL+SSToolkitAdditions.m
View
@@ -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];
}
2  SSToolkit/SSAddressBarTextField.m
View
@@ -42,8 +42,6 @@ - (void)setLoading:(BOOL)isLoading {
- (void)dealloc {
self.reloadButton = nil;
self.stopButton = nil;
- [_textFieldBackgroundView release];
- [super dealloc];
}
8 SSToolkit/SSAddressBarTextFieldBackgroundView.m
View
@@ -42,14 +42,6 @@ - (void)setLoading:(BOOL)isLoading {
}
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_innerView release];
- [super dealloc];
-}
-
-
#pragma mark - UIView
- (id)initWithFrame:(CGRect)aFrame {
5 SSToolkit/SSAnimatedImageView.m
View
@@ -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;
}
8 SSToolkit/SSBadgeTableViewCell.m
View
@@ -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 {
31 SSToolkit/SSBadgeView.m
View
@@ -29,51 +29,37 @@ @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];
}
@@ -81,7 +67,6 @@ - (void)setBadgeAlignment:(SSBadgeViewAlignment)badgeAlignment {
- (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 {
27 SSToolkit/SSBorderedView.m
View
@@ -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 {
28 SSToolkit/SSCollectionView.m
View
@@ -77,29 +77,21 @@ - (void)dealloc {
self.delegate = nil;
[_visibleItems removeAllObjects];
- [_visibleItems release];
_visibleItems = nil;
[_reuseableItems removeAllObjects];
- [_reuseableItems release];
_reuseableItems = nil;
_tableView.dataSource = nil;
_tableView.delegate = nil;
- [_tableView release];
[_sectionCache removeAllObjects];
- [_sectionCache release];
_sectionCache = nil;
[_updates removeAllObjects];
- [_updates release];
_updates = nil;
- [_rowBackgroundColor release];
_rowBackgroundColor = nil;
-
- [super dealloc];
}
@@ -149,11 +141,11 @@ - (SSCollectionViewItem *)dequeueReusableItemWithIdentifier:(NSString *)identifi
return nil;
}
- SSCollectionViewItem *item = [[items lastObject] retain];
+ SSCollectionViewItem *item = [items lastObject];
[items removeObject:item];
[item prepareForReuse];
- return [item autorelease];
+ return item;
}
@@ -248,7 +240,7 @@ - (NSArray *)indexPathsForVisibleRows {
for (SSCollectionViewItem *item in _visibleItems) {
[indexPaths addObject:[self indexPathForItem:item]];
}
- return [indexPaths autorelease];
+ return indexPaths;
}
@@ -402,9 +394,7 @@ - (void)endUpdates {
}
}
}
-
- [sections release];
-
+
// Apply updates
[_tableView endUpdates];
@@ -481,8 +471,7 @@ - (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths {
[rowIndexPaths addObject:rowIndexPath];
}
}];
- [_tableView reloadRowsAtIndexPaths:rowIndexPaths withRowAnimation:UITableViewRowAnimationFade];
- [rowIndexPaths release];
+ [_tableView reloadRowsAtIndexPaths:rowIndexPaths withRowAnimation:UITableViewRowAnimationFade];
}
@@ -655,7 +644,7 @@ - (NSArray *)_itemsForRowIndexPath:(NSIndexPath *)rowIndexPath {
NSUInteger startIndex = itemsPerRow * row;
NSUInteger endIndex = (NSUInteger)fmin(totalItems, startIndex + itemsPerRow);
- NSMutableArray *items = [[[NSMutableArray alloc] initWithCapacity:endIndex - startIndex] autorelease];
+ NSMutableArray *items = [[NSMutableArray alloc] initWithCapacity:endIndex - startIndex];
for (NSUInteger i = startIndex; i < endIndex; i++) {
NSIndexPath *itemIndexPath = [NSIndexPath indexPathForRow:i inSection:rowIndexPath.section];
@@ -766,7 +755,6 @@ - (NSMutableDictionary *)_sectionInfoForIndex:(NSUInteger)section {
dictionary = [[NSMutableDictionary alloc] init];
[_sectionCache setObject:dictionary forKey:sectionKey];
- [dictionary release];
return dictionary;
}
@@ -813,7 +801,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
if (cellType != SSCollectionViewCellTypeRow) {
SSCollectionViewExtremityTableViewCell *cell = (SSCollectionViewExtremityTableViewCell *)[_tableView dequeueReusableCellWithIdentifier:extremityCellIdentifier];
if (!cell) {
- cell = [[[SSCollectionViewExtremityTableViewCell alloc] initWithReuseIdentifier:extremityCellIdentifier] autorelease];
+ cell = [[SSCollectionViewExtremityTableViewCell alloc] initWithReuseIdentifier:extremityCellIdentifier];
}
cell.extrimityView = [self _extremityViewForSection:rowIndexPath.section type:cellType];
@@ -824,7 +812,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
// Normal row
SSCollectionViewItemTableViewCell *cell = (SSCollectionViewItemTableViewCell *)[_tableView dequeueReusableCellWithIdentifier:itemCellIdentifier];
if (!cell) {
- cell = [[[SSCollectionViewItemTableViewCell alloc] initWithReuseIdentifier:itemCellIdentifier] autorelease];
+ cell = [[SSCollectionViewItemTableViewCell alloc] initWithReuseIdentifier:itemCellIdentifier];
cell.collectionView = self;
}
2  SSToolkit/SSCollectionViewController.m
View
@@ -33,8 +33,6 @@ - (id)init {
- (void)dealloc {
_collectionView.dataSource = nil;
_collectionView.delegate = nil;
- [_collectionView release];
- [super dealloc];
}
10 SSToolkit/SSCollectionViewExtremityTableViewCell.m
View
@@ -15,23 +15,13 @@ @implementation SSCollectionViewExtremityTableViewCell
@synthesize extrimityView = _extrimityView;
- (void)setExtrimityView:(UIView *)view {
- [view retain];
[_extrimityView removeFromSuperview];
- [_extrimityView release];
_extrimityView = view;
[self addSubview:_extrimityView];
[self setNeedsLayout];
}
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_extrimityView release];
- [super dealloc];
-}
-
-
#pragma mark - UIView
- (void)layoutSubviews {
18 SSToolkit/SSCollectionViewItem.m
View
@@ -15,8 +15,6 @@
@implementation SSCollectionViewItem {
SSCollectionViewItemStyle _style;
- SSCollectionView *_collectionView;
- NSIndexPath *_indexPath;
}
@@ -34,10 +32,7 @@ @implementation SSCollectionViewItem {
@synthesize collectionView = _collectionView;
- (void)setBackgroundView:(UIView *)backgroundView {
- [backgroundView retain];
- [_backgroundView release];
_backgroundView = backgroundView;
-
_backgroundView.hidden = _selected && _selectedBackgroundView;
[self insertSubview:backgroundView atIndex:0];
@@ -46,10 +41,7 @@ - (void)setBackgroundView:(UIView *)backgroundView {
- (void)setSelectedBackgroundView:(UIView *)selectedBackgroundView {
- [selectedBackgroundView retain];
- [_selectedBackgroundView release];
- _selectedBackgroundView = selectedBackgroundView;
-
+ _selectedBackgroundView = selectedBackgroundView;
_selectedBackgroundView.hidden = !_selected;
if (_backgroundView) {
@@ -66,14 +58,6 @@ - (void)setSelectedBackgroundView:(UIView *)selectedBackgroundView {
- (void)dealloc {
self.collectionView = nil;
- [_indexPath release];
- [_imageView release];
- [_textLabel release];
- [_detailTextLabel release];
- [_backgroundView release];
- [_selectedBackgroundView release];
- [_reuseIdentifier release];
- [super dealloc];
}
4 SSToolkit/SSCollectionViewItemTableViewCell.m
View
@@ -22,8 +22,7 @@ @implementation SSCollectionViewItemTableViewCell
- (void)setItems:(NSArray *)someItems {
[_items makeObjectsPerformSelector:@selector(removeFromSuperview)];
- [_items release];
- _items = [someItems retain];
+ _items = someItems;
if (_items == nil) {
return;
@@ -44,7 +43,6 @@ - (void)setItems:(NSArray *)someItems {
- (void)dealloc {
self.collectionView = nil;
self.items = nil;
- [super dealloc];
}
3  SSToolkit/SSDrawingUtilities.m
View
@@ -117,9 +117,8 @@ CGGradientRef SSCreateGradientWithColorsAndLocations(NSArray *colors, NSArray *l
[gradientColors addObject:(id)[(UIColor *)object CGColor]];
}];
- CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (CFArrayRef)gradientColors, gradientLocations);
+ CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (__bridge CFArrayRef)gradientColors, gradientLocations);
- [gradientColors release];
if (gradientLocations) {
free(gradientLocations);
}
11 SSToolkit/SSGradientView.m
View
@@ -28,16 +28,12 @@ @implementation SSGradientView {
- (void)setColors:(NSArray *)colors {
- [colors retain];
- [_colors release];
_colors = colors;
[self _refreshGradient];
}
- (void)setLocations:(NSArray *)locations {
- [locations retain];
- [_locations release];
_locations = locations;
[self _refreshGradient];
}
@@ -87,7 +83,6 @@ - (void)setTopColor:(UIColor *)topColor {
NSMutableArray *newColors = [colors mutableCopy];
[newColors replaceObjectAtIndex:0 withObject:topColor];
self.colors = newColors;
- [newColors release];
return;
}
@@ -107,7 +102,6 @@ - (void)setBottomColor:(UIColor *)bottomColor {
NSMutableArray *newColors = [colors mutableCopy];
[newColors replaceObjectAtIndex:count - 1 withObject:bottomColor];
self.colors = newColors;
- [newColors release];
} else if (count == 1) {
self.colors = [NSArray arrayWithObjects:[colors objectAtIndex:0], bottomColor, nil];
} else {
@@ -119,13 +113,8 @@ - (void)setBottomColor:(UIColor *)bottomColor {
#pragma mark - NSObject
- (void)dealloc {
- [_colors release];
- [_locations release];
-
CGGradientRelease(_gradient);
_gradient = nil;
-
- [super dealloc];
}
10 SSToolkit/SSHUDView.m
View
@@ -71,13 +71,7 @@ - (id)init {
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
-
[self _removeWindow];
- [_activityIndicator release];
- [_textLabel release];
- [_completeImage release];
- [_failImage release];
- [super dealloc];
}
@@ -183,7 +177,7 @@ - (id)initWithTitle:(NSString *)aTitle loading:(BOOL)isLoading {
- (void)show {
- [self retain];
+// [self retain];
if (!_hudWindow) {
_hudWindow = [SSHUDWindow defaultWindow];
}
@@ -265,7 +259,7 @@ - (void)failQuicklyWithTitle:(NSString *)aTitle {
- (void)dismiss {
- [self autorelease];
+// [self autorelease];
[self dismissAnimated:YES];
}
21 SSToolkit/SSLineView.m
View
@@ -20,48 +20,29 @@ @implementation SSLineView
@synthesize dashLengths = _dashLengths;
- (void)setLineColor:(UIColor *)lineColor {
- [lineColor retain];
- [_lineColor release];
_lineColor = lineColor;
-
[self setNeedsDisplay];
}
- (void)setInsetColor:(UIColor *)insetColor {
- [insetColor retain];
- [_insetColor release];
- _insetColor = insetColor;
-
+ _insetColor = insetColor;
[self setNeedsDisplay];
}
- (void)setDashPhase:(CGFloat)dashPhase {
_dashPhase = dashPhase;
-
[self setNeedsDisplay];
}
- (void)setDashLengths:(NSArray *)dashLengths {
- [_dashLengths autorelease];
_dashLengths = [dashLengths copy];
-
[self setNeedsDisplay];
}
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_lineColor release];
- [_insetColor release];
- [_dashLengths release];
- [super dealloc];
-}
-
-
#pragma mark - UIView
- (id)initWithCoder:(NSCoder *)aDecoder {
9 SSToolkit/SSLoadingView.m
View
@@ -24,15 +24,6 @@ @implementation SSLoadingView
@synthesize activityIndicatorView = _activityIndicatorView;
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_textLabel release];
- [_activityIndicatorView release];
- [super dealloc];
-}
-
-
#pragma mark - UIView
- (id)initWithCoder:(NSCoder *)aDecoder {
10 SSToolkit/SSPickerViewController.m
View
@@ -25,14 +25,6 @@ - (id)init {
}
-- (void)dealloc {
- [_keys release];
- [_selectedKey release];
- [_currentIndexPath release];
- [super dealloc];
-}
-
-
#pragma mark - UIViewController Methods
- (void)viewDidLoad {
@@ -94,7 +86,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
+ cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
id key = [self.keys objectAtIndex:indexPath.row];
cell.textLabel.text = [self cellTextForKey:key];
20 SSToolkit/SSPieProgressView.m
View
@@ -33,33 +33,23 @@ - (void)setProgress:(CGFloat)newProgress {
- (void)setPieBorderWidth:(CGFloat)pieBorderWidth {
_pieBorderWidth = pieBorderWidth;
-
[self setNeedsDisplay];
}
- (void)setPieBorderColor:(UIColor *)pieBorderColor {
- [pieBorderColor retain];
- [_pieBorderColor release];
_pieBorderColor = pieBorderColor;
-
[self setNeedsDisplay];
}
- (void)setPieFillColor:(UIColor *)pieFillColor {
- [pieFillColor retain];
- [_pieFillColor release];
_pieFillColor = pieFillColor;
-
[self setNeedsDisplay];
}
- (void)setPieBackgroundColor:(UIColor *)pieBackgroundColor {
- [pieBackgroundColor retain];
- [_pieBackgroundColor release];
_pieBackgroundColor = pieBackgroundColor;
-
[self setNeedsDisplay];
}
@@ -71,16 +61,6 @@ + (UIColor *)defaultPieColor {
}
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_pieBorderColor release];
- [_pieFillColor release];
- [_pieBackgroundColor release];
- [super dealloc];
-}
-
-
#pragma mark - UIView
- (id)initWithCoder:(NSCoder *)aDecoder {
20 SSToolkit/SSRatingPicker.m
View
@@ -61,47 +61,29 @@ - (void)settotalNumberOfStars:(NSUInteger)totalNumberOfStars {
- (void)setEmptyStarImage:(UIImage *)emptyStarImage {
- [emptyStarImage retain];
- [_emptyStarImage release];
_emptyStarImage = emptyStarImage;
-
[self setNeedsDisplay];
}
- (void)setFilledStarImage:(UIImage *)filledStarImage {
- [filledStarImage retain];
- [_filledStarImage release];
- _filledStarImage = filledStarImage;
-
+ _filledStarImage = filledStarImage;
[self setNeedsDisplay];
}
- (void)setStarSize:(CGSize)starSize {
_starSize = starSize;
-
[self setNeedsDisplay];
}
- (void)setStarSpacing:(CGFloat)starSpacing {
_starSpacing = starSpacing;
-
[self setNeedsDisplay];
}
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_emptyStarImage release];
- [_filledStarImage release];
- [_textLabel release];
- [super dealloc];
-}
-
-
#pragma mark - UIResponder
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
12 SSToolkit/SSRatingPickerScrollView.m
View
@@ -26,18 +26,6 @@ @implementation SSRatingPickerScrollView {
@synthesize titleTextField = _titleTextField;
@synthesize reviewTextView = _reviewTextView;
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_topView release];
- [_gradientView release];
- [_ratingPicker release];
- [_titleTextField release];
- [_lineView release];
- [_reviewTextView release];
- [super dealloc];
-}
-
#pragma mark - UIView
4 SSToolkit/SSRatingPickerViewController.m
View
@@ -44,9 +44,7 @@ - (SSTextView *)reviewTextView {
#pragma mark - UIViewController
- (void)loadView {
- SSRatingPickerScrollView *scrollView = [[SSRatingPickerScrollView alloc] initWithFrame:CGRectZero];
- self.view = scrollView;
- [scrollView release];
+ self.view = [[SSRatingPickerScrollView alloc] initWithFrame:CGRectZero];
}
57 SSToolkit/SSSegmentedControl.m
View
@@ -36,10 +36,7 @@ - (NSUInteger)numberOfSegments {
@synthesize buttonImage = _buttonImage;
- (void)setButtonImage:(UIImage *)buttonImage {
- [buttonImage retain];
- [_buttonImage release];
_buttonImage = buttonImage;
-
[self setNeedsDisplay];
}
@@ -47,10 +44,7 @@ - (void)setButtonImage:(UIImage *)buttonImage {
@synthesize highlightedButtonImage = _highlightedButtonImage;
- (void)setHighlightedButtonImage:(UIImage *)highlightedButtonImage {
- [highlightedButtonImage retain];
- [_highlightedButtonImage release];
_highlightedButtonImage = highlightedButtonImage;
-
[self setNeedsDisplay];
}
@@ -58,10 +52,7 @@ - (void)setHighlightedButtonImage:(UIImage *)highlightedButtonImage {
@synthesize dividerImage = _dividerImage;
- (void)setDividerImage:(UIImage *)dividerImage {
- [dividerImage retain];
- [_dividerImage release];
_dividerImage = dividerImage;
-
[self setNeedsDisplay];
}
@@ -69,10 +60,7 @@ - (void)setDividerImage:(UIImage *)dividerImage {
@synthesize highlightedDividerImage = _highlightedDividerImage;
- (void)setHighlightedDividerImage:(UIImage *)highlightedDividerImage {
- [highlightedDividerImage retain];
- [_highlightedDividerImage release];
_highlightedDividerImage = highlightedDividerImage;
-
[self setNeedsDisplay];
}
@@ -80,10 +68,7 @@ - (void)setHighlightedDividerImage:(UIImage *)highlightedDividerImage {
@synthesize font = _font;
- (void)setFont:(UIFont *)font {
- [font retain];
- [_font release];
_font = font;
-
[self setNeedsDisplay];
}
@@ -91,20 +76,14 @@ - (void)setFont:(UIFont *)font {
@synthesize textColor = _textColor;
- (void)setTextColor:(UIColor *)textColor {
- [textColor retain];
- [_textColor release];
- _textColor = textColor;
-
+ _textColor = textColor;
[self setNeedsDisplay];
}
@synthesize disabledTextColor = _disabledTextColor;
- (void)setDisabledTextColor:(UIColor *)disabledTextColor {
- [disabledTextColor retain];
- [_disabledTextColor release];
- _disabledTextColor = disabledTextColor;
-
+ _disabledTextColor = disabledTextColor;
[self setNeedsDisplay];
}
@@ -112,10 +91,7 @@ - (void)setDisabledTextColor:(UIColor *)disabledTextColor {
@synthesize textShadowColor = _textShadowColor;
- (void)setTextShadowColor:(UIColor *)textShadowColor {
- [textShadowColor retain];
- [_textShadowColor release];
- _textShadowColor = textShadowColor;
-
+ _textShadowColor = textShadowColor;
[self setNeedsDisplay];
}
@@ -124,7 +100,6 @@ - (void)setTextShadowColor:(UIColor *)textShadowColor {
- (void)setTextShadowOffset:(CGSize)textShadowOffset {
_textShadowOffset = textShadowOffset;
-
[self setNeedsDisplay];
}
@@ -133,7 +108,6 @@ - (void)setTextShadowOffset:(CGSize)textShadowOffset {
- (void)setTextEdgeInsets:(UIEdgeInsets)textEdgeInsets {
_textEdgeInsets = textEdgeInsets;
-
[self setNeedsDisplay];
}
@@ -157,23 +131,6 @@ - (void)setFrame:(CGRect)rect {
}
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_segments release];
- [_buttonImage release];
- [_highlightedButtonImage release];
- [_dividerImage release];
- [_highlightedDividerImage release];
- [_font release];
- [_textColor release];
- [_disabledTextColor release];
- [_textShadowColor release];
- [_segmentMeta release];
- [super dealloc];
-}
-
-
#pragma mark - UIResponder
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
@@ -419,10 +376,10 @@ - (void)_initialize {
self.highlightedDividerImage = [UIImage imageNamed:@"UISegmentBarDividerHighlighted.png" bundleName:kSSToolkitBundleName];
self.selectedSegmentIndex = SSSegmentedControlNoSegment;
- _font = [[UIFont boldSystemFontOfSize:12.0f] retain];
- _textColor = [[UIColor whiteColor] retain];
- _disabledTextColor = [[UIColor colorWithWhite:0.561f alpha:1.0f] retain];
- _textShadowColor = [[UIColor colorWithWhite:0.0f alpha:0.5f] retain];
+ _font = [UIFont boldSystemFontOfSize:12.0f];
+ _textColor = [UIColor whiteColor];
+ _disabledTextColor = [UIColor colorWithWhite:0.561f alpha:1.0f];
+ _textShadowColor = [UIColor colorWithWhite:0.0f alpha:0.5f];
_textShadowOffset = CGSizeMake(0.0f, -1.0f);
_textEdgeInsets = UIEdgeInsetsMake(-1.0f, 0.0f, 0.0f, 0.0f);
}
10 SSToolkit/SSTextField.m
View
@@ -22,8 +22,6 @@ @implementation SSTextField
@synthesize placeholderTextColor = _placeholderTextColor;
- (void)setPlaceholderTextColor:(UIColor *)placeholderTextColor {
- [placeholderTextColor retain];
- [_placeholderTextColor release];
_placeholderTextColor = placeholderTextColor;
if (!self.text && self.placeholder) {
@@ -32,14 +30,6 @@ - (void)setPlaceholderTextColor:(UIColor *)placeholderTextColor {
}
-#pragma mark - NSObject
-
-- (void)dealloc {
- [_placeholderTextColor release];
- [super dealloc];
-}
-
-
#pragma mark - UIView
- (id)initWithCoder:(NSCoder *)aDecoder {
8 SSToolkit/SSTextView.m
View
@@ -36,9 +36,7 @@ - (void)setPlaceholder:(NSString *)string {
return;
}
- [_placeholder release];
- _placeholder = [string retain];
-
+ _placeholder = string;
[self _updateShouldDrawPlaceholder];
}
@@ -47,10 +45,6 @@ - (void)setPlaceholder:(NSString *)string {
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self name:UITextViewTextDidChangeNotification object:self];
-
- [_placeholder release];
- [_placeholderColor release];
- [super dealloc];
}
9 SSToolkit/SSWebView.m
View
@@ -38,9 +38,6 @@ - (void)dealloc {
_delegate = nil;
_webView.delegate = nil;
[_webView stopLoading];
- [_webView release];
- [_lastRequest release];
- [super dealloc];
}
@@ -102,7 +99,6 @@ - (void)reset {
tempMediaPlaybackRequiresUserAction = _webView.mediaPlaybackRequiresUserAction;
[_webView removeFromSuperview];
- [_webView release];
}
_webView = [[UIWebView alloc] initWithFrame:CGRectZero];
@@ -313,9 +309,7 @@ - (void)loadRequest:(NSURLRequest *)aRequest {
- (void)reload {
- [_lastRequest release];
_lastRequest = nil;
-
[_webView reload];
}
@@ -413,8 +407,7 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
// Starting a new request
if ([[aRequest mainDocumentURL] isEqual:[_lastRequest mainDocumentURL]] == NO) {
- [_lastRequest release];
- _lastRequest = [aRequest retain];
+ _lastRequest = aRequest;
_testedDOM = NO;
[self _startLoading];
11 SSToolkit/UIView+SSToolkitAdditions.m
View
@@ -31,31 +31,28 @@ - (void)show {
- (void)fadeOut {
- UIView *view = [self retain];
+ UIView *view = self;
[UIView animateWithDuration:0.2 delay:0.0 options:UIViewAnimationOptionAllowUserInteraction animations:^{
view.alpha = 0.0f;
} completion:nil];
- [view autorelease];
}
- (void)fadeOutAndRemoveFromSuperview {
- UIView *view = [self retain];
+ UIView *view = self;
[UIView animateWithDuration:0.2 delay:0.0 options:UIViewAnimationOptionAllowUserInteraction animations:^{
view.alpha = 0.0f;
} completion:^(BOOL finished) {
[view removeFromSuperview];
}];
- [view autorelease];
}
- (void)fadeIn {
- UIView *view = [self retain];
+ UIView *view = self;
[UIView animateWithDuration:0.2 delay:0.0 options:UIViewAnimationOptionAllowUserInteraction animations:^{
view.alpha = 1.0f;
} completion:nil];
- [view autorelease];
}
@@ -74,7 +71,7 @@ - (NSArray *)superviews {
view = superview;
}
- return [superviews autorelease];
+ return superviews;
}
1  SSToolkit/UIViewController+SSToolkitAdditions.m
View
@@ -26,7 +26,6 @@ - (void)displayErrorString:(NSString *)string {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:string delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
- [alert release];
}
@end
Please sign in to comment.
Something went wrong with that request. Please try again.