Skip to content

Question: How are these accessors supposed to be invoked? #9

@hokster7

Description

@hokster7

The README states that the following methods are generated, but how on Earth is the user supposed to call them?:

- (void)insertObject:(NSManagedObject *)value in<Key>AtIndex:(NSUInteger)idx;
- (void)removeObjectFrom<Key>AtIndex:(NSUInteger)idx;
- (void)insert<Key>:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
- (void)remove<Key>AtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectIn<Key>AtIndex:(NSUInteger)idx withObject:(NSManagedObject *)value;
- (void)replace<Key>AtIndexes:(NSIndexSet *)indexes with<Key>:(NSArray *)values;
- (void)add<Key>Object:(NSManagedObject *)value;
- (void)remove<Key>Object:(NSManagedObject *)value;
- (void)add<Key>:(NSOrderedSet *)values;
- (void)remove<Key>:(NSOrderedSet *)values;

The IDE nor the compiler will pick these up because they're dynamically generated.

I can only imagine that the intended way to invoke these methods is to use performSelector: or dispatch_sync() or some such. These are quite unsafe to call.

I currently maintain positionIndex field for entities that require some specific ordering. Managing these indices is becoming a bit of a pain and probably doesn't scale well. It may become necessary to introduce an intermediate object. Sadly, KCOrderedAccessorFix has not been the fix I'd been hoping for.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions