# Chapter 3, converting the relationship to unordered set (NSSet)

**URL:** <https://forums.kodeco.com/t/chapter-3-converting-the-relationship-to-unordered-set-nsset/18553>\
**Category:** Core Data by Tutorials\
**Created:** [August 17, 2016, 1:19am UTC](https://forums.kodeco.com/t/chapter-3-converting-the-relationship-to-unordered-set-nsset/18553 "2016-08-17T01:19:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![djdew](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/djdew/32/81494_2.png) [@djdew](https://forums.kodeco.com/u/djdew)\
**Post date:** [August 17, 2016, 1:19am UTC](https://forums.kodeco.com/t/chapter-3-converting-the-relationship-to-unordered-set-nsset/18553/1 "2016-08-17T01:19:15Z")

</div>

Hello;

The Note on page 78 states that if the walks relationship was unordered one could set the “one” side of the relationship via the following code in the “add” function:

walk.dog = currentDog

I’ve done so (after commenting out the NSMutableOrderedSet and NSOrderedSet lines) and now the following line of code in cellForRowAtIndexPath fails:

let walk = currentDog.walks![indexPath.row] as! Walk

because “Type NSSet has no subscript members”, which makes sense. What would cellForRowAtIndexPath (and any other applicable function) look like in the case of an unordered relationship?

TIA

---

<div class="post-metadata">

**Author:** ![easye80](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/easye80/32/102075_2.png) [@easye80](https://forums.kodeco.com/u/easye80)\
**Post date:** [January 24, 2017, 7:48pm UTC](https://forums.kodeco.com/t/chapter-3-converting-the-relationship-to-unordered-set-nsset/18553/2 "2017-01-24T19:48:30Z")

</div>

Bumping this because I have the same question. From what I have read, it is very rare to need to use NSOrderedSet, so it is strange that they would use that in the example.

---

<div class="post-metadata">

**Author:** ![lauriehouse](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/lauriehouse/32/81494_2.png) [@lauriehouse](https://forums.kodeco.com/u/lauriehouse)\
**Post date:** [January 9, 2019, 7:05pm UTC](https://forums.kodeco.com/t/chapter-3-converting-the-relationship-to-unordered-set-nsset/18553/3 "2019-01-09T19:05:07Z")

</div>

Did anyone ever figure out why this happens?

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [January 9, 2019, 7:13pm UTC](https://forums.kodeco.com/t/chapter-3-converting-the-relationship-to-unordered-set-nsset/18553/4 "2019-01-09T19:13:55Z")

</div>

@pietrorea Can you please help with this when you get a chance? Thank you - much appreciated! :]
