Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordered Relationships, how? #1

Open
helje5 opened this issue Sep 26, 2023 · 0 comments
Open

Ordered Relationships, how? #1

helje5 opened this issue Sep 26, 2023 · 0 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@helje5
Copy link
Contributor

helje5 commented Sep 26, 2023

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.

@helje5 helje5 added help wanted Extra attention is needed question Further information is requested labels Sep 26, 2023
@helje5 helje5 changed the title Ordered Attributes, how? Ordered Relationships, how? Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant