I’m using Core Data to store a project name and display it in a table view. When the table view is empty (no data in the database) it is blank. From a user perspective this isn’t great, so I want to be able to display a label that says “No Projects”.
How would I do this? I would need to:
- Check that the database is empty and set a BOOL
- if this BOOL is set to true or YES, show a label? or set the cell.textLabel.text as “No Projects”
If i’m on the right tracks I’d really appreciate some example code to give me a push in the right direction.
Thanks
I ended up using the following code to check if my Core Data database is empty. Works brilliantly. This must go in the CoreDataController.m file.