title: Objective-C Substring with range
body: <p>I have an NSString that points to a URL, something like this:</p>
  
  <pre><code>https://.../uploads/video/video_file/115/spin_37.mp4
  </code></pre>
  
  <p>I want to get the filename in my iOS app from the NSString (in this example, spin_37.mp4)</p>
  
  <p>I'm trying the following:</p>
  
  <pre><code>NSUInteger *startIndex = [self.videoURL rangeOfString:@"/" options:NSBackwardsSearch].location+1;
  NSUInteger *endIndex = [self.videoURL length] - startIndex;
  
  NSString *fileName = [self.videoURL substringWithRange:(startIndex, endIndex)];
  </code></pre>
  
  <p>But I'm running into a lot of errors with NSUInteger, namely right now </p>
  
  <pre><code>Invalid operands to binary expression ('unsigned long' and 'NSUInteger *' (aka 'unsigned long *'))
  </code></pre>
  
  <p>Can someone explain what I'm doing wrong?</p>