Static Table View Cells | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/10796666-table-views/lessons/11

Hi, at the end of this lesson i got errors in my Library.swift for each book that said:
Missing argument for parameter ‘review’ in call
Insert ‘, review: <#String?#>’
I resolved it by adding “review:nil” to the end of each library book instance. I am wondering why you didn’t get that same error when building and running in the video?
Thanks

Hi! I suspect your review property in Book is a constant instead of a variable.

So, if you have this:

let review: String?

That means review has to be set at initialization, since it can’t be changed later on. To fix it up, just change that let to var

var review: String?

Hi, I’d like to know what’s the best table view type (dynamic vs static) for informations that won’t change in a Medical education app. By example, I’m creating a menu with different clinical signs and each clinical sign is linked to a specific table view. Thanks!

Hi! It sounds like a cool project!

My advice would be to consider how different you want each cell to be. If you want a table view full of cells that would use the same layout, and just link to different places, then I’d go for dynamic. If you have different content and layout needs for each cell, then consider static.

How would you put a dictionary [String: [String]] in a list? I have a JSON file that looks like that, but I can’t find a way to put the “ethology” into a list… Need help haha!

{
“name”: “Acouphènes”,
“category”: “ORL”,
“description”: "Bourdonnement, sifflement ou tintement entendu dans les oreilles ou dans la tête ",
“id”: 63,
“isFeatured”: false,
“isFavorite”: false,
“Drapeaux rouges”: [
“Pulsatile”,
“Surdité unilatérale progressive (neurinome acoustique)”,
“Céphalée (migraine ou LOE)”,
“Symptômes neurologiques focaux (LOE)”,
“Crises d’épilepsie (LOE)”,
“Atteitnes des NC”,
“Symptômes B (néoplasie)”
],
“etiologies”: {
“VASCULAIRE”: [
“Malformations artérioveineuses”,
“Anévrysme vasculaire”,
“Sténose carotidienne”,
“Dissection carotidienne”,
“Murmure veineux”,
“Souffle cardiaque”,
“Shunt auriculo-ventriculaire”,
“Hyperthyroïdie”,
“Grossesse”,
“Anémie”],
“NEUROLOGIQUE”: [
“Sclérose en plaques”,
“Neurosyphillis”,
“Méningiome”,
“Migraine”,
“Hypertension intracrânienne bénigne”],
“NEUROSENSORIEL”: [
“Presbyacousie”,
“Otosclérose”,
“Otite moyenne aiguë”,
“Barotrauma”,
“Traumatisme sonore”,
“Médicaments ototoxiques (salicylates)”,
“Maladie de Ménière”,
“Attteinte du nerf cochléaire”,
“Malformation de Budd-Chiari”,
“Schwannome vestibulaire”,
“ORL”,
“Dysfonction tubaire”,
“Labyrinthite virale”,
“Cholestéatome”,
“Spasmes du muscle tenseur du tympan (NC V)”,
“Spasme du muscle stapédien (NC VII)”,
“Myoclonies palatines”,
“Bouchon de cérumen”,
“Neuronome acoustique”],
“AUTRES”: [
“Dépression”,
“Anxiété”,
“Post-traumatique”,
“Arthrose cervicale”]
}

Hey! I recommend checking out Part 2 of the Saving Data in iOS course: https://www.raywenderlich.com/5429634-saving-data-in-ios

It’s all about working with JSON :]