Post

Replies

Boosts

Views

Activity

Comment on FetchedResults to Array
So my FetchedResults is gotten from this: @FetchRequest(sortDescriptors: [SortDescriptor(\.date, order: .reverse)]) var recipes: FetchedResults<Recipe> and I need to put the data (list of recipes) from that into my array of recipes: @State private var searchArray = [Recipe]()
Jun ’22
Comment on Searching with @FetchRequest
I’m getting some errors when I try that. What do I need to do to fix this? •Value of optional type 'String?' must be unwrapped to refer to member 'contains' of wrapped base type 'String' •Chain the optional using '?' to access member 'contains' only for non-'nil' base values •Force-unwrap using '!' to abort execution if the optional value contains 'nil'
Jun ’22