title: Using Swift to sort array of NSString's results in low memory warning
body: <p>I'm implementing a search function in which the end result is an <code>Array</code> of <code>NSString</code>, sorted by how closely they resemble the search string.  The fuzzy match algorithm is custom, and typically doesn't have a problem.</p>
  
  <p>It does, however, have a memory issue when the <code>Array</code> contains thousands of <code>NSString</code> that are very similar (i.e. Title, Copy of Title, Title 2).  Instruments reports that the persistent memory at the time of crash is 98% from <code>malloc</code> of <code>NSString</code> with my fuzzy match algorithm being the responsible caller.</p>
  
  <p>On smaller sets (2,000 random strings) that don't crash, the memory is released and everything appears behave expectedly.  Any thoughts on how to decrease the large memory usage?</p>
  
  <pre><code>data = data.filter({ (item) -&gt; Bool in
      var itemString = self.converter(item)
      return itemString.scoreAgainst(string) &gt; 0
  }).sorted({ (item1, item2) -&gt; Bool in
      var string1 = self.converter(item1)
      var string2 = self.converter(item2)
      return string1.scoreAgainst(string) &gt; string2.scoreAgainst(string)
  })
  </code></pre>
  
  <p>The method <code>scoreAgainst</code> is really kosher.  It just does a series of lowercasing, uppercasing, <code>rangeOfString:</code> and <code>substringWithRange:</code> to give a score for the match.</p>