# Chapter 6 - Testing Sequential Migrations

**URL:** <https://forums.kodeco.com/t/chapter-6-testing-sequential-migrations/61124>\
**Category:** Core Data by Tutorials\
**Created:** [January 31, 2019, 4:52pm UTC](https://forums.kodeco.com/t/chapter-6-testing-sequential-migrations/61124 "2019-01-31T16:52:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cantyd](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/cantyd/32/81494_2.png) [@cantyd](https://forums.kodeco.com/u/cantyd)\
**Post date:** [January 31, 2019, 4:52pm UTC](https://forums.kodeco.com/t/chapter-6-testing-sequential-migrations/61124/1 "2019-01-31T16:52:31Z")

</div>

I’m trying to test sequential migrations and the migrations appear to work, but the app is giving me a warning **Multiple NSEntityDescriptions claim the NSManagedObject subclass ‘UnCloudNotes.Note’ so +entity is unable to disambiguate.**

The app then crashes when it tries to set up the fetched results controller in NotesListViewController (the sort descriptor is not set up as a result of the above warning):

fileprivate lazy var notes: NSFetchedResultsController = {  
let context = self.stack.managedContext  
let request = Note.fetchRequest() as! NSFetchRequest  
request.sortDescriptors = [NSSortDescriptor(key: #keyPath(Note.dateCreated), ascending: false)]

```
let notes = NSFetchedResultsController(fetchRequest: request, managedObjectContext: context, sectionNameKeyPath: nil, cacheName: nil)
notes.delegate = self
return notes

```

}()

I’ve followed everything line by line so I don’t know why this error is appearing.

---

<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:** [January 31, 2019, 6:48pm UTC](https://forums.kodeco.com/t/chapter-6-testing-sequential-migrations/61124/2 "2019-01-31T18:48:10Z")

</div>

> [@cantyd](#):
>
> Multiple NSEntityDescriptions claim the NSManagedObject subclass ‘UnCloudNotes.Note’ so +entity is unable to disambiguate.

Assuming you didn’t create two Note.swift classes, you may have the CodeGen setting for Note in the entity designer set to create a class. It should be set to None. It sounds like it is creating a Note class, which will be hidden, and that generated class is in conflict with the Note.swift class you already have.

---

<div class="post-metadata">

**Author:** ![cantyd](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/cantyd/32/81494_2.png) [@cantyd](https://forums.kodeco.com/u/cantyd)\
**Post date:** [January 31, 2019, 7:42pm UTC](https://forums.kodeco.com/t/chapter-6-testing-sequential-migrations/61124/3 "2019-01-31T19:42:23Z")

</div>

The CodeGen setting for Note is set to Manual/None.

However, when I changed the fetch request in NotesListViewController from

let request = Note.fetchRequest() as! NSFetchRequest\<Note\>

to

let request: NSFetchRequest\<Note\> = NSFetchRequest(entityName: “Note”)

all works fine. Problem solved.

---

<div class="post-metadata">

**Author:** ![yossa\_bourne](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/yossa_bourne/32/105896_2.png) [@yossa\_bourne](https://forums.kodeco.com/u/yossa_bourne)\
**Post date:** [July 10, 2019, 6:59am UTC](https://forums.kodeco.com/t/chapter-6-testing-sequential-migrations/61124/4 "2019-07-10T06:59:27Z")

</div>

I faced the same problem. I applied your solution and problem solved as well.

---

<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:** [July 17, 2019, 8:52am UTC](https://forums.kodeco.com/t/chapter-6-testing-sequential-migrations/61124/5 "2019-07-17T08:52:35Z")

</div>

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