summaryrefslogtreecommitdiff
path: root/tikzit/src/common/GraphElementProperty.m
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2017-01-02 11:31:52 +0100
committerAleks Kissinger <aleks0@gmail.com>2017-01-02 11:31:52 +0100
commitff79a9c213dfd75ea00ed5112d3a6e314601e064 (patch)
tree19ecef47bf11803fc4fc59e06c185c65aa7fdd19 /tikzit/src/common/GraphElementProperty.m
parent9e4f8a6ff37161da4fa0af14604ad22d9c212fde (diff)
parent49c0d2041f0aae6d08d325b7f7fc1cd707d942f8 (diff)
Merge branch 'arc'
Diffstat (limited to 'tikzit/src/common/GraphElementProperty.m')
-rw-r--r--tikzit/src/common/GraphElementProperty.m20
1 files changed, 19 insertions, 1 deletions
diff --git a/tikzit/src/common/GraphElementProperty.m b/tikzit/src/common/GraphElementProperty.m
index 3cf6632..25e1b15 100644
--- a/tikzit/src/common/GraphElementProperty.m
+++ b/tikzit/src/common/GraphElementProperty.m
@@ -28,13 +28,25 @@
@implementation GraphElementProperty
+ (id)atom:(NSString*)n {
- return [[[self alloc] initWithAtomName:n] autorelease];
+#if __has_feature(objc_arc)
+ return [[self alloc] initWithAtomName:n];
+#else
+ return [[[self alloc] initWithAtomName:n] autorelease];
+#endif
}
+ (id)property:(NSString*)k withValue:(NSString*)v {
+#if __has_feature(objc_arc)
+ return [[self alloc] initWithPropertyValue:v forKey:k];
+#else
return [[[self alloc] initWithPropertyValue:v forKey:k] autorelease];
+#endif
}
+ (id)keyMatching:(NSString*)k {
+#if __has_feature(objc_arc)
+ return [[self alloc] initWithKeyMatching:k];
+#else
return [[[self alloc] initWithKeyMatching:k] autorelease];
+#endif
}
- (id)initWithAtomName:(NSString*)n {
@@ -65,14 +77,18 @@
}
- (void) dealloc {
+#if ! __has_feature(objc_arc)
[key release];
[value release];
[super dealloc];
+#endif
}
- (void)setValue:(NSString *)v {
if (value != v) {
+#if ! __has_feature(objc_arc)
[value release];
+#endif
value = [v copy];
}
}
@@ -88,7 +104,9 @@
- (void)setKey:(NSString *)k {
if (key != k) {
+#if ! __has_feature(objc_arc)
[key release];
+#endif
key = [k copy];
}
if (key == nil)