title: how to give componentsSeparatedByString on regular expression in iphone
body: <p>Hello friends,</p>
  
  <p>I am doing regulation here i create all and i store in array and print that in console also but i give in group also but when i give <code>componentsSeparatedByString</code> is not working why where i am wrong when i doing this code my application goin crash and log message print this meassage:-</p>
  
  <pre><code>[__NSCFArray componentsSeparatedByString:]: unrecognized selector sent to instance 0x4e283a0
      2011-09-12 14:05:48.400 RegexKitLiteDemo[10576:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray componentsSeparatedByString:]: unrecognized selector sent to instance 0x4e283a0
  </code></pre>
  
  <p>This is my code please some one help me in right direction</p>
  
  <pre><code>-(void)sendRequest
  
  {
      // create the request
      NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.bookryanair.com/SkySales/FRSearch.aspx"]
                                                cachePolicy:NSURLRequestUseProtocolCachePolicy
                                            timeoutInterval:60.0];
  
      NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
      if (theConnection) {
  
          webData = [[NSMutableData data] retain];
          NSLog(@"%@",webData);
      } else {
          // inform the user that the download could not be made
      }   
  
  }
  
  /// this for checking is that Sync is work or not 
  
  -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 
  {   
      [webData setLength: 0]; 
  
  
  } 
  
  -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 
  {         
      [webData appendData:data]; 
  
  } 
  
  -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 
  {     
      [connection release];  
      [webData release]; 
      NSLog(@"Connection failed! Error - %@ %@",
            [error localizedDescription],
            [[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]);
  
  } 
  
  -(void)connectionDidFinishLoading:(NSURLConnection *)connection 
  {      
      loginStatus = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding]; 
  
  
  
      [connection release];
  
      NSString *regexString = @"Stations\\[""(.*)""\\] = new Station\\((.*)new Array\\((.*)\\)\\);"; 
      matchArray = [loginStatus arrayOfCaptureComponentsMatchedByRegex:regexString];
  
  
  
  
      NSLog(@"matchArray: %@", matchArray);
  
  
      group = [[NSMutableArray alloc] initWithCapacity:[matchArray count]];
  
      for (int i = 0; i &lt; [matchArray count]; i++) {
  
           NSString *temp = [[matchArray objectAtIndex: i] componentsSeparatedByString: @","];
  
          [group addObject: temp];
      NSLog(@"group: %@", group);  
      }   
  } 
  </code></pre>