Hi
Im strugeling in fetching data from core data first it was the egenric thing Im not sure if its solved or not, aftering getting an array of managed objects Im struggeling feeding its data to table view cell, I think it suppose to be a simple task ?
--
Kindest Regards
h ttps://www.dropbox.com/s/vb3cet085v05tvi/Core%20Data%20Simple.zip?dl=0
Cannot launch the app. Crashes because "normalCell" cannot be dequeued in ViewController (cellForRowAt).
Just had to add to cell in IB.
Now, I get one cell with Iraq / Asia.
What do you expect here ?
What is the request that does not work ?
Is it this one:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.context = testData()
// let students: NSFetchRequest = Student.fetchRequest
let students = NSFetchRequest(entityName: "Student")
try! results = context!.execute(students) as? [NSManagedObject]
// results = context.executeFetchRequest(students) as? [NSManagedObject]
}
results is nil, because execute does not return the correct type.
Use instead:
try! results = context!.fetch(students) as? [NSManagedObject]
Read this for (some) details: