title: How to filter a multi-dimensional array
body: <p>I have the following multi-dimensional array (stripped and reduced for clarity)</p>
  
  <pre><code>[
      {
          "type": "type1",
          "docs": [
              {
                  "language": "EN"
              },
              {
                  "language": "DE"
              },
              {
                  "language": "EN"
              }
          ]
      },
      {
          "type": "type2",
          "docs": [
              {
                  "language": "EN"
              }
          ]
      },
      {
          "type": "type3",
          "docs": [
              {
                  "language": "FR"
              },
              {
                  "language": "DE"
              },
              {
                  "language": "DE"
              }
          ]
      }
  ]
  </code></pre>
  
  <p>I want to filter it, so only docs objects with a language of DE are shown. In other words, I need this:</p>
  
  <pre><code>[
      {
          "type": "type1",
          "docs": [
              {
                  "language": "DE"
              }
          ]
      },
      {
          "type": "type2",
          "docs": []
      },
      {
          "type": "type3",
          "docs": [
              {
                  "language": "DE"
              },
              {
                  "language": "DE"
              }
          ]
      }
  ]
  </code></pre>
  
  <p>My array is initially created by the following piece of code:</p>
  
  <pre><code>NSMutableArray *docsArray;
  [self setDocsArray:[downloadedDocsArray mutableCopy]];
  </code></pre>
  
  <p>I have tried looping the array and removing unwanted objects. I have tried looping the array and copying wanted objects to a new array. I have tried using NSPredicate instead of looping, all of which had very little success.</p>
  
  <p>Can anyone point me in the right direction?</p>
  
  <p>Thanks in advance.</p>