title: Find all locations of substring in NSString (not just first)
body: <p>There is a substring that occurs in a string several times. I use <code>rangeOfString</code>, but it seems that it can only find the first location. How can I find all the locations of the substring?</p>
  
  <pre><code>NSString *subString1 = @"&lt;/content&gt;";
  NSString *subString2 = @"--\n";
  NSRange range1 = [newresults rangeOfString:subString1];
  NSRange range2 = [newresults rangeOfString:subString2];
  int location1 = range1.location;
  int location2 = range2.location;
  NSLog(@"%i",location1);
  NSLog(@"%i",location2);
  </code></pre>