Why am I getting this error while looping through an array of dictionaries? Product {tableView.registerNib (for nil, forCellReuseIdentifier: identifier) for meh () method causes the following error in the Collector.append (asdf) return collector}
forin
in the loop: '[[String:>
We can not walk through the keys and values of an array of dictionaries, though we can repeat through the dictionaries again and for each dictionary, we can repeat through our keys and values:Product for Dict in Product (= Identifier, Nib) Product = BuildCell () Produce {tableview.registerNib (Nib, ForCellReuseIdentifier: Identifier)}}
But I think The problem is actually more likely to be that which is going on buildCells ()
. Why are you returning an array of dictionaries? Do you have a duplicate key plan? I do not think Tableview will allow you to enter multiple registrations for the same identifier.
Why do not we return only one dictionary?
func buildCells () - & gt; [String: uinib] {var dict = [string: uinib] () dick ["identifier"] = uuneb (nickname: "table viewule", bundle: zero) // rinse & amp;
Now we can iterate over a key / value combination in the dictionary without the external keyboard:
No comments:
Post a Comment