Checklists: Question about DataModel:registerUserDefaults

Maybe I missed this somewhere, but how is it that this only gets executed the first time the app is run? In other words, how is it not executed every time “init()” is executed when the app is started?

So when ChecklistIndex is initially set to -1, how is it not reset to that value when the app is launched again?

It does get executed the next time you run the app but because by then you already have a saved version of the NSUserDefaults (in a file on disk). So the “default defaults” are still registered but they are not used since you have written values to NSUserDefaults last time you ran the app, and these override the defaults. Does that make sense?

Thanks. Sorry for the delayed response.