user4951
user4951

Reputation: 33138

Why do we have mutableOrderedSetValueForKey yet not OrderedSetValueForKey?

What about if we just want to look at what's there rather wanting to change stuff and then we want to access it by it's key rather than using dot notation?

For example:

I have object called CatalogData

I can do CatalogData.Images to get the pages.

However, say I have a function that return NSManagedObject and I want to pass @"Images" to that function.

So, eventually it'll get something like

[anNSManagedObjectThatisactuallyaCatalogData orderdSetforKey:@"Images"]

Well, we can't have that.

So why?

Should we use the good old objectForKey?

Upvotes: 0

Views: 558

Answers (1)

Martin R
Martin R

Reputation: 540065

You can just use

[anNSManagedObjectThatisactuallyaCatalogData valueForKey:@"Images"]

which returns an NSOrderedSet if "Images" is an ordered to-many relationship.

Upvotes: 2

Related Questions