i am trying to make relation entity between 2 entities
, unfortunately its not working well since i am still new with swift.
for example i have playlist
table and songs
table i want to make relation between them ?
and this is the Fetch Request :
let fetchRequest = NSFetchRequest(entityName: "Playlist")
// // Add Sort Descriptor
// let sortDescriptor = NSSortDescriptor(key: "playlist_name", ascending: true)
// fetchRequest.sortDescriptors = [sortDescriptor]
let context = Appdelegate().managedObjectContext
// Execute Fetch Request
do {
let result = try context.executeFetchRequest(fetchRequest)
print(result)
} catch {
let fetchError = error as NSError
print(fetchError)
}
can i create third table to make relation between songs and playlists like this ?