title: Instantiate new array for each TableViewCell
body: <p><strong>The objective</strong></p>
  <ul>
  <li>Create a new array of strings for each individual table view cell.</li>
  </ul>
  <p><strong>The Problem</strong></p>
  <ul>
  <li><p>Every time I append to the array of Strings for each individual JSON Object, the appending doesn't append to the array for each individual cell; the appending is for the whole entire feed of JSON objects, thus, ending up with an array of every JSON object that is being fetched.. (I need a separate array for each separate cell)</p>
  <p>for example =</p>
  </li>
  <li><p>cell 1 = [&quot;hello&quot;, &quot;thank you&quot;, &quot;welcome&quot;]</p>
  </li>
  <li><p>cell 2 = [&quot;America&quot;, &quot;China&quot;, &quot;Russia&quot;]</p>
  </li>
  <li><p>cell 3 = [&quot;Patatoe&quot;, &quot;Orange&quot;, &quot;Apple&quot;]</p>
  </li>
  <li><p>Ect...</p>
  </li>
  </ul>
  <p><strong>What I'm Doing?</strong></p>
  <ul>
  <li>I'm pulling an array of strings from firebase and appending the values to an empty array instantiated inside the cellForRowAtIndexPath method.</li>
  </ul>
  <p>CODE</p>
  <pre><code> var peopleWhomAreInvited = [String]()
          
      Database.database().reference().child(&quot;following&quot;).child((currentUser?.uid)!).observe(.childAdded, with: { (snapshot) in
          Database.fetchUserWithUID(uid: snapshot.key) { (user) in
              let allUserRef =  Database.database().reference().child(&quot;plans&quot;).child((user.uid))
              
              allUserRef.observeSingleEvent(of: .value, with: { (snapshot) in
                  guard let dictionaries = snapshot.value as? [String: Any] else { return }
                  dictionaries.forEach({ (key, value) in
                      
                      let peopleAttendingRef = allUserRef.child(key).child(&quot;invited&quot;).observe(.childAdded, with: { (peopleSnapshot) in
                          let personsRef = allUserRef.child(key).child(&quot;invited&quot;).child(peopleSnapshot.key)
                          personsRef.observe(.childAdded, with: { (personSnapshot) in
                              guard let peopleAttendingDictionary = personSnapshot.value as? String else { return }
                              peopleWhomAreInvited.append(peopleAttendingDictionary)
                              print(&quot;THIS IS WHO I INVITED&quot;, peopleWhomAreInvited)
                          })
                      })
                  })
                  
              })
          }
      })
  </code></pre>
  <p><strong>What Have I Tried?</strong></p>
  <p>I've tried:</p>
  <ul>
  <li><p>to declare the array outside of the cellForRowAtIndexPath method and in the cell</p>
  </li>
  <li><p>create a dictionary with a value of arrays and (unsuccessfully) append the array to each key (which is the indexPath.row).</p>
  </li>
  <li><p>declare the fetch method inside the cell and not in the cellForRowAtIndexPath</p>
  </li>
  </ul>
  <p>I'm not sure what to do ... If you have any ideas please let me know.</p>