title: componentsSeparatedByString method in Swift
body: <p>I had some troubles last night accessing the elements of an array created via the componentsSeparatedByStringMethod. My goal is to extract some information from an url content variable. </p>
  
  <pre><code>var arr = urlContent.componentsSeparatedByString("&lt;span class=\"Some  HTML class\"&gt;")
  </code></pre>
  
  <p>I printed arr to the log, it works perfectly</p>
  
  <p>I'd like to access the second element of the array arr, in order to get the info I need (the information right after the span tag). I thought:</p>
  
  <pre><code>var info = arr[1]
  </code></pre>
  
  <p>would work, but it doesn't. I get an error message saying that the subscript method doesn't work for an object of type "AnyObject" or something similar. So the problem is arr is not an Array Object type but an AnyObject type. I tried to convert it to an array but it didn't work either.</p>
  
  <p>Could anybody help through this little trouble? :)</p>