Skip to content

Commit 272db3d

Browse files
committed
Removed the cpt_weak definition and removed it from all property declarations. It was redundant and caused problems with client code that does not use ARC. Fixed issue core-plot#269.
1 parent 54d3a16 commit 272db3d

25 files changed

Lines changed: 39 additions & 52 deletions

framework/Source/CPTAnimationOperation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
/// @name Delegate
2222
/// @{
23-
@property (nonatomic, cpt_weak_property, nullable) cpt_weak id<CPTAnimationDelegate> delegate;
23+
@property (nonatomic, cpt_weak_property, nullable) id<CPTAnimationDelegate> delegate;
2424
/// @}
2525

2626
/// @name Status

framework/Source/CPTAnimationOperation.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ @implementation CPTAnimationOperation
3131
**/
3232
@synthesize boundSetter;
3333

34-
/** @property nullable cpt_weak id<CPTAnimationDelegate>delegate
34+
/** @property nullable id<CPTAnimationDelegate>delegate
3535
* @brief The animation delegate.
3636
**/
3737
@synthesize delegate;

framework/Source/CPTAnnotation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ typedef NSMutableArray<__kindof CPTAnnotation *> *CPTMutableAnnotationArray;
1919
@interface CPTAnnotation : NSObject<NSCoding>
2020

2121
@property (nonatomic, readwrite, strong, nullable) CPTLayer *contentLayer;
22-
@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTAnnotationHostLayer *annotationHostLayer;
22+
@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAnnotationHostLayer *annotationHostLayer;
2323
@property (nonatomic, readwrite, assign) CGPoint contentAnchorPoint;
2424
@property (nonatomic, readwrite, assign) CGPoint displacement;
2525
@property (nonatomic, readwrite, assign) CGFloat rotation;

framework/Source/CPTAnnotation.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ @implementation CPTAnnotation
1616
**/
1717
@synthesize contentLayer;
1818

19-
/** @property nullable cpt_weak CPTAnnotationHostLayer *annotationHostLayer
19+
/** @property nullable CPTAnnotationHostLayer *annotationHostLayer
2020
* @brief The host layer for the annotation content.
2121
**/
2222
@synthesize annotationHostLayer;

framework/Source/CPTAxis.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@ typedef NSMutableArray<__kindof CPTAxis *> *CPTMutableAxisArray;
282282
/// @name Layers
283283
/// @{
284284
@property (nonatomic, readwrite, assign) BOOL separateLayers;
285-
@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTPlotArea *plotArea;
286-
@property (nonatomic, readonly, nullable) cpt_weak CPTGridLines *minorGridLines;
287-
@property (nonatomic, readonly, nullable) cpt_weak CPTGridLines *majorGridLines;
285+
@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTPlotArea *plotArea;
286+
@property (nonatomic, readonly, cpt_weak_property, nullable) CPTGridLines *minorGridLines;
287+
@property (nonatomic, readonly, cpt_weak_property, nullable) CPTGridLines *majorGridLines;
288288
@property (nonatomic, readonly, nullable) CPTAxisSet *axisSet;
289289
/// @}
290290

framework/Source/CPTAxis.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
@interface CPTAxis()
3333

3434
@property (nonatomic, readwrite, assign) BOOL needsRelabel;
35-
@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTGridLines *minorGridLines;
36-
@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTGridLines *majorGridLines;
37-
@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTAxisLabel *pointingDeviceDownLabel;
38-
@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTAxisLabel *pointingDeviceDownTickLabel;
35+
@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGridLines *minorGridLines;
36+
@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGridLines *majorGridLines;
37+
@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAxisLabel *pointingDeviceDownLabel;
38+
@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAxisLabel *pointingDeviceDownTickLabel;
3939
@property (nonatomic, readwrite, assign) BOOL labelFormatterChanged;
4040
@property (nonatomic, readwrite, assign) BOOL minorLabelFormatterChanged;
4141
@property (nonatomic, readwrite, strong, nullable) CPTMutableLimitBandArray mutableBackgroundLimitBands;
@@ -429,17 +429,17 @@ @implementation CPTAxis
429429
**/
430430
@synthesize separateLayers;
431431

432-
/** @property nullable cpt_weak CPTPlotArea *plotArea
432+
/** @property nullable CPTPlotArea *plotArea
433433
* @brief The plot area that the axis belongs to.
434434
**/
435435
@synthesize plotArea;
436436

437-
/** @property nullable cpt_weak CPTGridLines *minorGridLines
437+
/** @property nullable CPTGridLines *minorGridLines
438438
* @brief The layer that draws the minor grid lines.
439439
**/
440440
@synthesize minorGridLines;
441441

442-
/** @property nullable cpt_weak CPTGridLines *majorGridLines
442+
/** @property nullable CPTGridLines *majorGridLines
443443
* @brief The layer that draws the major grid lines.
444444
**/
445445
@synthesize majorGridLines;
@@ -450,13 +450,13 @@ @implementation CPTAxis
450450
@dynamic axisSet;
451451

452452
/** @internal
453-
* @property nullable cpt_weak CPTAxisLabel *pointingDeviceDownLabel
453+
* @property nullable CPTAxisLabel *pointingDeviceDownLabel
454454
* @brief The label that was selected on the pointing device down event.
455455
**/
456456
@synthesize pointingDeviceDownLabel;
457457

458458
/** @internal
459-
* @property nullable cpt_weak CPTAxisLabel *pointingDeviceDownTickLabel
459+
* @property nullable CPTAxisLabel *pointingDeviceDownTickLabel
460460
* @brief The tick label that was selected on the pointing device down event.
461461
**/
462462
@synthesize pointingDeviceDownTickLabel;

framework/Source/CPTDefinitions.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
* @brief Defined as @num{1} if the compiler and active SDK support weak references, @num{0} otherwise.
1010
**/
1111

12-
/**
13-
* @def cpt_weak
14-
* @hideinitializer
15-
* @brief A custom definition for automatic reference counting (ARC) weak references that falls back to
16-
* <code>__unsafe_unretained</code> values on older platforms.
17-
**/
18-
1912
/**
2013
* @def cpt_weak_property
2114
* @hideinitializer
@@ -34,15 +27,9 @@
3427
#endif
3528

3629
#if CPT_SDK_SUPPORTS_WEAK
37-
#define cpt_weak __weak
3830
#define cpt_weak_property weak
3931
#else
40-
#if __clang__ && (__clang_major__ >= 3)
41-
#define cpt_weak __unsafe_unretained
42-
#else
43-
#define cpt_weak
44-
#endif
45-
#define cpt_weak_property assign
32+
#define cpt_weak_property unsafe_unretained
4633
#endif
4734

4835
// Deprecated method attribute

framework/Source/CPTGraph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ typedef NS_ENUM (NSInteger, CPTGraphLayerType) {
6464

6565
/// @name Hosting View
6666
/// @{
67-
@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTGraphHostingView *hostingView;
67+
@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGraphHostingView *hostingView;
6868
/// @}
6969

7070
/// @name Title

framework/Source/CPTGraph.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ -(CGPoint)contentAnchorForRectAnchor:(CPTRectAnchor)anchor;
6666
**/
6767
@implementation CPTGraph
6868

69-
/** @property nullable cpt_weak CPTGraphHostingView *hostingView
69+
/** @property nullable CPTGraphHostingView *hostingView
7070
* @brief The hosting view that contains the graph.
7171
**/
7272
@synthesize hostingView;

framework/Source/CPTGridLineGroup.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@interface CPTGridLineGroup : CPTLayer
66

7-
@property (nonatomic, readwrite, cpt_weak_property, nullable) cpt_weak CPTPlotArea *plotArea;
7+
@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTPlotArea *plotArea;
88
@property (nonatomic, readwrite) BOOL major;
99

1010
@end

0 commit comments

Comments
 (0)