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 :]