saving a data source

i have a data source for my table view, and i was wondering how i would save the data source when i quit the app, then load it from the file on open. I was thinking it could be written to defaults. I’ve searched around a lot and couldnt find an answer.

EDIT: i found this and it worked great.