I don't think we have an existing API for -become:, but it should be pretty easy to do (certainly possible using only public API.)
However, in this case, it wouldn't do what you want, because the list of objects a tag is applied to is stored in the COTag. So to merge two tags, all you need to do is: COTag *tagToDrop = ...; COTag *tagToKeep = ...; [[tagToKeep mutableArrayValueForKey: @"objects"] addObjectsFromArray: tagToDrop.objects] tagToDrop.objects = @[]; (not sure why the tag contents are ordered..) Next you would delete any references to 'tagToDrop' (e.g. from a tag collection), and it would get GC'ed. Another point, you don't need to use COTag if you don't want to. You could make a tags property that is an unordered collection of strings which are interned. See TestUnorderedAttribute.m and UnorderedAttributeModel.m for an example of how to do this. The reason for including COTag in CoreObject was so you could tag any COObject. -Eric On Mon, Sep 21, 2015 at 3:33 AM, David Chisnall <[email protected]> wrote: > Hi, > > I’m looking a bit at the tags support. Given that tags are implemented as > full objects and not interned, I’d like to be able to merge tags if the > user gives two tags with the same name (it’s hard to present a coherent UI > that has two tags with the same name). Doing the merging, however, > requires replacing all references to one UUID with another. Is there > existing functionality for this, or does it need adding? > > David > > -- Sent from my Cray X1 > > > _______________________________________________ > Etoile-dev mailing list > [email protected] > https://mail.gna.org/listinfo/etoile-dev >
_______________________________________________ Etoile-dev mailing list [email protected] https://mail.gna.org/listinfo/etoile-dev
