if I run the app for the first time after inserted the populate method, the app crashed the reason:
Unexpectedly found nil while unwrapping an Optional value
in the line:
favoriteLabel.hidden = !bowtie.isFavorite!.boolValue
Thanks for your help:)
Looks like isFavorite is an uninitialised optional at that stage then. Where is it supposed to be initialised?
isFavorite isn’t initialized bevor, just created in the entity editor, as all of the attributes
Ah OK. So in the find or create method that creates that managed object you probably need to assign a default value to isFavorite - or at least refrain from reading it until a value is assigned somewhere.