Revision: 29664
          http://sourceforge.net/p/bibdesk/svn/29664
Author:   hofman
Date:     2025-10-04 15:08:43 +0000 (Sat, 04 Oct 2025)
Log Message:
-----------
new designated initializer for category parnt

Modified Paths:
--------------
    trunk/bibdesk/BDSKParentGroup.h
    trunk/bibdesk/BDSKParentGroup.m

Modified: trunk/bibdesk/BDSKParentGroup.h
===================================================================
--- trunk/bibdesk/BDSKParentGroup.h     2025-10-04 14:52:35 UTC (rev 29663)
+++ trunk/bibdesk/BDSKParentGroup.h     2025-10-04 15:08:43 UTC (rev 29664)
@@ -102,7 +102,9 @@
     NSString *key;
 }
 
-- (instancetype)initWithKey:(NSString *)aKey;
+- (instancetype)initWithKey:(NSString *)aKey NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithCoder:(NSCoder *)coderr NS_DESIGNATED_INITIALIZER;
+- (instancetype)initWithName:(id)aName NS_UNAVAILABLE;
 
 @property (nonatomic, strong) NSArray *categoryGroups;
 

Modified: trunk/bibdesk/BDSKParentGroup.m
===================================================================
--- trunk/bibdesk/BDSKParentGroup.m     2025-10-04 14:52:35 UTC (rev 29663)
+++ trunk/bibdesk/BDSKParentGroup.m     2025-10-04 15:08:43 UTC (rev 29664)
@@ -324,7 +324,7 @@
 @dynamic categoryGroups;
 
 - (instancetype)initWithKey:(NSString *)aKey {
-    self = [self initWithName:aKey];
+    self = [super initWithName:aKey];
     if (self) {
         key = aKey;
     }
@@ -331,6 +331,19 @@
     return self;
 }
 
+- (instancetype)initWithCoder:(NSCoder *)decoder {
+    self = [super initWithCoder:decoder];
+    if (self) {
+        key = [decoder decodeObjectForKey:@"key"];
+    }
+    return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder {
+    [super encodeWithCoder:coder];
+    [coder encodeObject:key forKey:@"key"];
+}
+
 - (BDSKGroupType)groupType { return BDSKCategoryParentGroupType; }
 
 // category parents aren't unique, so we need to use a different identifier 
for remembering expanded state

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to