Skip to content

Commit

Permalink
Save object archive as pure dictionary, non-referential, remove objec…
Browse files Browse the repository at this point in the history
…ts array
  • Loading branch information
gcasa committed Aug 31, 2024
1 parent 9244822 commit 0b1de36
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions XCode/NSObject+KeyExtraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
+ (NSArray *) skippedKeys;
- (NSArray *) keysForObject: (id)object;
- (NSDictionary *) recursiveKeysAndValuesForObject: (id)object;
- (NSDictionary *) referentialArchive;
- (NSDictionary *) allKeysAndValues;

@end
14 changes: 14 additions & 0 deletions XCode/NSObject+KeyExtraction.m
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,18 @@ - (NSDictionary *) allKeysAndValues
return [self recursiveKeysAndValuesForObject: self];
}

- (NSDictionary *) _recursivelyCreateReferentialArchive: (id)obj
{
}

- (NSDictionary *) referentialArchive: (NSDictionary *)dict
{
return dict;
}

- (NSDictionary *) referentialArchive
{
return [self referentialArchive: [self allKeysAndValues]];
}

@end
3 changes: 2 additions & 1 deletion XCode/PBXCoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ - (instancetype) initWithRootObject: (id)root

- (id) archive
{
return [_rootObject allKeysAndValues];
NSDictionary *plist = [_rootObject allKeysAndValues]; // referentialArchive];
return plist; // [self _createReferenceBasedArchive: plist];
}

@end
4 changes: 4 additions & 0 deletions XCode/PBXContainer.m
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ - (BOOL) save
BOLD, YELLOW, [fn cString], RESET, GREEN,
[dn cString], RESET);

// Clear the cached objects dictionary;
[self setObjects: [NSMutableDictionary dictionary]];

// Save the project...
if (created && !error)
{
PBXCoder *coder = [[PBXCoder alloc] initWithRootObject: self];
Expand Down

0 comments on commit 0b1de36

Please sign in to comment.