Skip navigation.
 
mlNSString and string contains
FROM : Tom Jones
DATE : Sun Mar 02 21:31:44 2008

Hello,
I'm fairly new to Cocoa, so please excuse me if I'm not using the 
right terminology.

I have an NSArray which contains String values and I want to loop 
though it and determine if any of those string contain words I'm 
looking for. I have tried but have been unsuccessful.

Example...

unsigned arrayCount = [array count];
for(unsigned j = 0; j < arrayCount; j++)
  {
   id obj;
   obj = [array objectAtIndex:j];
   /* Here is where I'm having trouble
   I know this is not real :-)
   if ( [obj inStr:@"home"])
   {
       NSLog(@"I found home, %@", obj);
   }
   */
}


I hope the example helps, thanks,
tom

Related mailsAuthorDate
mlNSString and string contains Tom Jones Mar 2, 21:31
mlRe: NSString and string contains Seth Willits Mar 2, 22:39
mlRe: NSString and string contains Andrew Merenbach Mar 2, 22:44
mlRe: NSString and string contains j o a r Mar 2, 23:01
mlRe: NSString and string contains Johannes Huning Mar 2, 23:02
mlRe: NSString and string contains Andrew Merenbach Mar 2, 23:16
mlRe: NSString and string contains Chris Hanson Mar 3, 05:45
mlRe: NSString and string contains Jens Alfke Mar 3, 07:50