title: Check for and return a non-constant integer in objective-c
body: <p>With reference to the following question "<a href="https://stackoverflow.com/questions/2753956/string-contains-string-in-objective-c" title="String contains string in objective-c">String contains string in objective-c</a>", 
  I have a HTTP server that returns the following header:</p>
  
  <p>P.S. Cannot attach a screenshot because I'm a new user, used blockquotes instead :( </p>
  
  <blockquote>
    <p>HTTP header: {</p>
    
    <p>-info omitted-</p>
    
    <p>Server = "HTTP Client Suite (Test case number:21)";</p>
  </blockquote>
  
  <p>The block of code which i have written to get a response from the HTTP server is:</p>
  
  <pre><code> - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
  {
      *- code omitted -*
  
       // **HTTP header field**
  
      // A dictionary containing all the HTTP header fields of the receiver
      // By examining this dictionary clients can see the “raw” header information returned by the server
      NSDictionary *headerField = [[NSDictionary alloc]initWithDictionary:[(NSHTTPURLResponse *)httpResponse allHeaderFields]];
  
      // Call headerField dictionary and format into a string
      NSString *headerString = [NSString stringWithFormat:@"%@", headerField];
  
      NSLog(@"HTTP Header: %@",headerString);
  
      // String to match (changeable) and temporary string to store variable
      NSString *stringToMatch = @"Test case number";
      NSString *tempString = @"";
  
      // Check if headerString contains a particular string
      // By finding and returning the range of the first occurrence of the given string (stringToMatch) within the receiver
      // If the string is not found/doesn't exists
      if ([headerString rangeOfString:stringToMatch].location == NSNotFound)
      {
          NSLog(@"Header does not contain the string: '%@'", stringToMatch);
          tempString = NULL;
          NSLog(@"String is %@", tempString);
      }
      else
      {
          NSLog(@"Header contains the string: '%@'", stringToMatch);
          tempString = stringToMatch;
          NSLog(@"String is '%@'", tempString);
      }
  
  }
  </code></pre>
  
  <p>What I'm doing here is to actually see if the string "Test case number" exists. If it does, then I would want to extract the number 21 and store it in a variable using NSInteger, the problem now is the number is mutable and not constant (it will change each time depending on what the HTTP server returns), therefore I'm unable to use the same approach which I did earlier on to check whether an integer exists within a string in this case.</p>
  
  <p>How do I go about achieving this? Thanks in advance!</p>