title: Cannot subscript a value of type '[(String)]?' with an index of type 'Int'
body: <p>I am trying to display a tableview of categories with each category having its own set of categories. </p>
  
  <p>For example, the main categories are food, entertainment, recreation, and within the food section of the tableview, mexican food, asian food etc are displayed under that section.  </p>
  
  <p>However, I am running into this error: </p>
  
  <blockquote>
    <p>Cannot subscript a value of type '[(String)]?' with an index of type 'Int'</p>
  </blockquote>
  
  <p>Here's my code:</p>
  
  <pre><code>var categoryDictionary = [String:[String]]();
  var categoriesList = ["Food", "Entertainment", "Recreation", "Shopping", "Transport", "Post Office"]
  var foodCategories = [String]();
  var entertainmentCategories = [String]();
  var recreationCategories = [String]();
  var shoppingCategories = [String]();
  var transportCategories = [String]();
  var lodgingCategories = [String]();
  var librariesCategories = [String]();
  var banksCategories = [String]();
  var postOfficeCategories = [String]();
  </code></pre>
  
  <p>Here's just an example of appending to the array and adding the key value of "Food" to the array of foodCategory</p>
  
  <pre><code>func setupCategoryFood() {
      var asianFood = "Asian Food"
      var mexicanFood = "Mexican Food"
      var fastFood = "Fast Food"
      var MiddleEasternFood = "Middle Eastern Food"
  
      foodCategories.append(asianFood);
      foodCategories.append(mexicanFood);
      foodCategories.append(fastFood);
      foodCategories.append(MiddleEasternFood);
  
      categoryDictionary["Food"] = foodCategories;
  }
  </code></pre>
  
  <p>and then...</p>
  
  <pre><code>func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -&gt; UITableViewCell {
  
      let cell:UITableViewCell = tableView.dequeueReusableCellWithIdentifier("myCell") as! UITableViewCell;
  
      var sectionTitle = categoriesList[indexPath.section]
      var sectionArray = categoryDictionary[sectionTitle];
      var itemInArray = sectionArray[indexPath.row];
  
      return cell
  }
  </code></pre>
  
  <p>I get the error when I try to set a variable to equal the item inside of the array at the given <strong>indexpath.row:</strong> </p>
  
  <blockquote>
    <p>'Cannot subscript a value of type '[(String)]?' with an index of type 'Int'</p>
  </blockquote>
  
  <p>I'm really confused why this isn't working, so any help would be great.</p>