0002-Convert-code-to-ARC.patch 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. From 885ddfe009c833098aa9eecdb839668ad9eb80d4 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <fkuehne@videolan.org>
  3. Date: Sun, 28 Apr 2013 17:14:56 +0200
  4. Subject: [PATCH 2/3] Convert code to ARC
  5. ---
  6. Classes/AQGridView.h | 8 ++++----
  7. Classes/AQGridView.m | 2 +-
  8. Classes/AQGridViewAnimatorItem.h | 2 +-
  9. Classes/AQGridViewCell.h | 10 +++++-----
  10. Classes/AQGridViewCell.m | 3 +--
  11. Classes/AQGridViewController.h | 2 +-
  12. Classes/AQGridViewUpdateInfo.m | 1 -
  13. 7 files changed, 13 insertions(+), 15 deletions(-)
  14. diff --git a/Classes/AQGridView.h b/Classes/AQGridView.h
  15. index 2f8d460..07b1bc8 100755
  16. --- a/Classes/AQGridView.h
  17. +++ b/Classes/AQGridView.h
  18. @@ -227,20 +227,20 @@ extern NSString * const AQGridViewSelectionDidChangeNotification;
  19. // this property is set to YES, or to vertical otherwise.
  20. @property (nonatomic, assign) BOOL clipsContentWidthToBounds __attribute__((deprecated)); // default is YES. If you want to enable horizontal scrolling, set this to NO.
  21. -@property (nonatomic, retain) UIView * backgroundView; // specifies a view to place behind the cells
  22. +@property (nonatomic, strong) UIView * backgroundView; // specifies a view to place behind the cells
  23. @property (nonatomic) BOOL backgroundViewExtendsUp; // default is NO. If YES, the background view extends upward and is visible during a bounce.
  24. @property (nonatomic) BOOL backgroundViewExtendsDown; // default is NO. If YES, the background view extends downward and is visible during a bounce.
  25. @property (nonatomic) BOOL usesPagedHorizontalScrolling; // default is NO, and scrolls verticalls only. Set to YES to have horizontal-only scrolling by page.
  26. @property (nonatomic) AQGridViewCellSeparatorStyle separatorStyle; // default is AQGridViewCellSeparatorStyleEmptySpace
  27. -@property (nonatomic, retain) UIColor * separatorColor; // ignored unless separatorStyle == AQGridViewCellSeparatorStyleSingleLine. Default is standard separator gray.
  28. +@property (nonatomic, strong) UIColor * separatorColor; // ignored unless separatorStyle == AQGridViewCellSeparatorStyleSingleLine. Default is standard separator gray.
  29. - (AQGridViewCell *) dequeueReusableCellWithIdentifier: (NSString *) reuseIdentifier;
  30. // Headers and Footers
  31. -@property (nonatomic, retain) UIView * gridHeaderView;
  32. -@property (nonatomic, retain) UIView * gridFooterView;
  33. +@property (nonatomic, strong) UIView * gridHeaderView;
  34. +@property (nonatomic, strong) UIView * gridFooterView;
  35. @property (nonatomic, assign) CGFloat leftContentInset;
  36. @property (nonatomic, assign) CGFloat rightContentInset;
  37. diff --git a/Classes/AQGridView.m b/Classes/AQGridView.m
  38. index 3f62735..babe070 100755
  39. --- a/Classes/AQGridView.m
  40. +++ b/Classes/AQGridView.m
  41. @@ -908,7 +908,7 @@ NSString * const AQGridViewSelectionDidChangeNotification = @"AQGridViewSelectio
  42. {
  43. NSAssert([_updateInfoStack lastObject] != nil, @"_updateInfoStack should not be empty at this point" );
  44. - __block AQGridViewUpdateInfo * info = [_updateInfoStack lastObject];
  45. + __weak AQGridViewUpdateInfo * info = [_updateInfoStack lastObject];
  46. if ( info.numberOfUpdates == 0 )
  47. {
  48. diff --git a/Classes/AQGridViewAnimatorItem.h b/Classes/AQGridViewAnimatorItem.h
  49. index a6449ef..0542e84 100644
  50. --- a/Classes/AQGridViewAnimatorItem.h
  51. +++ b/Classes/AQGridViewAnimatorItem.h
  52. @@ -12,7 +12,7 @@
  53. + (AQGridViewAnimatorItem *) itemWithView: (UIView *) aView index: (NSUInteger) anIndex;
  54. -@property (nonatomic, retain) UIView * animatingView; // probably an AQGridViewCell, maybe a UIImageView
  55. +@property (nonatomic, strong) UIView * animatingView; // probably an AQGridViewCell, maybe a UIImageView
  56. @property (nonatomic, assign) NSUInteger index; // the DESTINATION index -- use NSNotFound if this is being deleted
  57. - (NSUInteger) hash;
  58. diff --git a/Classes/AQGridViewCell.h b/Classes/AQGridViewCell.h
  59. index e23f978..4476791 100644
  60. --- a/Classes/AQGridViewCell.h
  61. +++ b/Classes/AQGridViewCell.h
  62. @@ -92,13 +92,13 @@ typedef enum {
  63. - (id) initWithFrame: (CGRect) frame reuseIdentifier: (NSString *) reuseIdentifier;
  64. // If you want to customize cells by simply adding additional views, you should add them to the content view so they will be positioned appropriately as the cell transitions into and out of editing mode.
  65. -@property (nonatomic, readonly, retain) UIView * contentView;
  66. +@property (nonatomic, readonly, strong) UIView * contentView;
  67. // default is nil. The background view will be added as a subview behind all other views
  68. -@property (nonatomic, retain) UIView * backgroundView;
  69. +@property (nonatomic, strong) UIView * backgroundView;
  70. // The 'selectedBackgroundView' will be added as a subview directly above the backgroundView if not nil, or behind all other views. It is added as a subview only when the cell is selected. Calling -setSelected:animated: will cause the 'selectedBackgroundView' to animate in and out with an alpha fade.
  71. -@property (nonatomic, retain) UIView * selectedBackgroundView;
  72. +@property (nonatomic, strong) UIView * selectedBackgroundView;
  73. @property (nonatomic, readonly, copy) NSString * reuseIdentifier;
  74. - (void) prepareForReuse; // if the cell is reusable (has a reuse identifier), this is called just before the cell is returned from the grid view method dequeueReusableCellWithIdentifier:. If you override, you MUST call super.
  75. @@ -106,12 +106,12 @@ typedef enum {
  76. @property (nonatomic) AQGridViewCellSelectionStyle selectionStyle; // default is AQGridViewCellSelectionStyleGlow
  77. @property (nonatomic, getter=isSelected) BOOL selected; // default is NO
  78. @property (nonatomic, getter=isHighlighted) BOOL highlighted; // default is NO
  79. -@property (nonatomic, retain) UIColor * selectionGlowColor; // default is dark grey, ignored if selectionStyle != AQGridViewCellSelectionStyleGlow
  80. +@property (nonatomic, strong) UIColor * selectionGlowColor; // default is dark grey, ignored if selectionStyle != AQGridViewCellSelectionStyleGlow
  81. @property (nonatomic) CGFloat selectionGlowShadowRadius; // default is 12.0, ignored if selectionStyle != AQGridViewCellSelectionStyleGlow
  82. // this can be overridden by subclasses to return a subview's layer to which to add the glow
  83. // the default implementation returns the contentView's layer
  84. -@property (nonatomic, readonly) CALayer * glowSelectionLayer;
  85. +@property (weak, nonatomic, readonly) CALayer * glowSelectionLayer;
  86. - (void) setSelected: (BOOL) selected animated: (BOOL) animated;
  87. - (void) setHighlighted: (BOOL) highlighted animated: (BOOL) animated;
  88. diff --git a/Classes/AQGridViewCell.m b/Classes/AQGridViewCell.m
  89. index 837586f..d5307df 100644
  90. --- a/Classes/AQGridViewCell.m
  91. +++ b/Classes/AQGridViewCell.m
  92. @@ -45,7 +45,7 @@
  93. #endif
  94. @interface AQGridViewCell ()
  95. -@property (nonatomic, retain) UIView * contentView;
  96. +@property (nonatomic, strong) UIView * contentView;
  97. @property (nonatomic, copy) NSString * reuseIdentifier;
  98. - (void) flipHighlightTimerFired: (NSTimer *) timer;
  99. @end
  100. @@ -98,7 +98,6 @@
  101. {
  102. if ( _selectionColorInfo != NULL )
  103. CFRelease( _selectionColorInfo );
  104. - [super dealloc];
  105. }
  106. - (NSComparisonResult) compareOriginAgainstCell: (AQGridViewCell *) otherCell
  107. diff --git a/Classes/AQGridViewController.h b/Classes/AQGridViewController.h
  108. index e23fb80..b89121b 100644
  109. --- a/Classes/AQGridViewController.h
  110. +++ b/Classes/AQGridViewController.h
  111. @@ -47,7 +47,7 @@
  112. BOOL _popoverShowing;
  113. }
  114. -@property (nonatomic, retain) AQGridView * gridView;
  115. +@property (nonatomic, strong) AQGridView * gridView;
  116. @property (nonatomic) BOOL clearsSelectionOnViewWillAppear;
  117. @end
  118. diff --git a/Classes/AQGridViewUpdateInfo.m b/Classes/AQGridViewUpdateInfo.m
  119. index 12d7665..9bf5148 100644
  120. --- a/Classes/AQGridViewUpdateInfo.m
  121. +++ b/Classes/AQGridViewUpdateInfo.m
  122. @@ -70,7 +70,6 @@
  123. free( _oldToNewIndexMap );
  124. if ( _newToOldIndexMap != NULL )
  125. free( _newToOldIndexMap );
  126. - [super dealloc];
  127. }
  128. - (NSMutableArray *) updateItemArrayForAction: (AQGridViewUpdateAction) action
  129. --
  130. 1.7.12.4 (Apple Git-37)