• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSString and string contains
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString and string contains


  • Subject: NSString and string contains
  • From: Tom Jones <email@hidden>
  • Date: Sun, 2 Mar 2008 12:31:44 -0800

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

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString and string contains
      • From: Chris Hanson <email@hidden>
    • Re: NSString and string contains
      • From: Andrew Merenbach <email@hidden>
    • Re: NSString and string contains
      • From: Seth Willits <email@hidden>
  • Prev by Date: Re: Custom View drawn twice?
  • Next by Date: Re: NSString and string contains
  • Previous by thread: Re: Custom View drawn twice?
  • Next by thread: Re: NSString and string contains
  • Index(es):
    • Date
    • Thread