Skip to content

Ordered Relationships, how? #1

Open
@helje5

Description

@helje5

Some support for NSOrderedSet is prepared in the codebase, need to test this and check what actually works.

A problem w/ NSOrderedSet is the lack of an associated type, i.e. it isn't a NSOrderedSet<T>. It can be subclassed in Swift like:

final class OrderedSet<T>: NSOrderedSet

but then the OrderedSet<T> can't be used w/ @NSManaged? (something about OrderedSet can't be used in ObjC).

So the minimal thing would be support for such:

@Model class Group: NSManagedObject {
  @Relationship(inverse: \Item.group)
  var items : NSOrderedSet
}

The target model type could be provided by the inverse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions