You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Say I add a group with path named @"Phone" to the root group. Then in that group, I add a group with path named @"@2x".
Then if I add a group to the root group called @"Pad", and in that group I add a group called @"@2x", it will have the same key as the first @"@2x" group, even though it is a different group.
In XCGroup's addGroupWithPath: method, you are generating the key just based on the passed in variable path, which is not the full path of the group, but the last path component, which could be the same as the last path component of other groups.
This is also an issue when you have two targets in a project that each need their own copy of a file. In this scenario the File Reference Key and Build File Reference Key of both files will be identical (due to hashing the path of the file relative to its parent group instead of the project's root). Both files will show up in Xcode's Project Navigator without any issue despite sharing a File Reference Record (since the path of the file is resolved relative to its parent group) but they cannot be independently added to to their own target.
Activity
jasperblues commentedon Jun 11, 2013
Can I offer you push access?
coduggan commentedon Jun 11, 2013
Sure
jasperblues commentedon Jun 11, 2013
Granted - thanks very much. . I've also added you as a contributor on the Readme - feel free to edit.
s-s-hardin commentedon Aug 22, 2014
This is also an issue when you have two targets in a project that each need their own copy of a file. In this scenario the File Reference Key and Build File Reference Key of both files will be identical (due to hashing the path of the file relative to its parent group instead of the project's root). Both files will show up in Xcode's Project Navigator without any issue despite sharing a File Reference Record (since the path of the file is resolved relative to its parent group) but they cannot be independently added to to their own target.
jasperblues commentedon Aug 23, 2014
It badly needs fixing. A quick fix, would be to add a time-component to the name-hashing that it used in:
https://github.com/jasperblues/XcodeEditor/blob/master/Source/Main/Utils/XCKeyBuilder.m
. . The method could also be marked synchronized, and have a small artificial delay (~1ms), to ensure a unique hash.