# MyLocation Chapter 28

**URL:** <https://forums.kodeco.com/t/mylocation-chapter-28/78695>\
**Category:** iOS Apprentice\
**Created:** [August 9, 2019, 5:23pm UTC](https://forums.kodeco.com/t/mylocation-chapter-28/78695 "2019-08-09T17:23:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![feanor](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/feanor/32/81494_2.png) [@feanor](https://forums.kodeco.com/u/feanor)\
**Post date:** [August 9, 2019, 5:23pm UTC](https://forums.kodeco.com/t/mylocation-chapter-28/78695/1 "2019-08-09T17:23:13Z")

</div>

I deleted all the tagged location item in my simulator, then when I try to tag a new location and save it, the app crashed.  
 ![26%20AM](https://files.chunter.kodeco.com/original/3X/7/1/7170fd6e5d10cbb50d151c430069bd1645d64203.jpeg)  
Does anyone know how to avoid unwrapping this nil optional?

---

<div class="post-metadata">

**Author:** ![sgerrard](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/sgerrard/32/93812_2.png) [@sgerrard](https://forums.kodeco.com/u/sgerrard)\
**Post date:** [August 10, 2019, 12:30am UTC](https://forums.kodeco.com/t/mylocation-chapter-28/78695/2 "2019-08-10T00:30:15Z")

</div>

For inserted rows, you use the **newIndexPath** parameter, not the **indexPath** parameter. So

```auto
      print("*** NSFetchedResultsChangeInsert (object)")
      tableView.insertRows(at: [newIndexPath!], with: .fade)

```

---

<div class="post-metadata">

**Author:** ![feanor](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/feanor/32/81494_2.png) [@feanor](https://forums.kodeco.com/u/feanor)\
**Post date:** [August 10, 2019, 3:39am UTC](https://forums.kodeco.com/t/mylocation-chapter-28/78695/3 "2019-08-10T03:39:17Z")

</div>

Thank you very much! How sloppy I was…

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [January 23, 2020, 9:23am UTC](https://forums.kodeco.com/t/mylocation-chapter-28/78695/4 "2020-01-23T09:23:13Z")

</div>

Closed on January 23, 2020, 9:23am UTC

This topic was automatically closed after 166 days. New replies are no longer allowed.
