Re: Checking One Array Against Another?
Re: Checking One Array Against Another?
- Subject: Re: Checking One Array Against Another?
- From: Ken Thomases <email@hidden>
- Date: Sat, 29 Nov 2008 17:34:29 -0600
On Nov 28, 2008, at 9:53 PM, Pierce Freeman wrote:
for (int arraySort = 0; arraySort < [arrayInfo count]; arraySort++)
{
for (int arrayNewSort = 0; arrayNewSort < [arrayNewInfo
count]; arrayNewSort++)
{
if ([ arrayInfo objectAtIndex:arraySort] ==
[arrayNewInfo objectAtIndex:arrayNewSort])
The above conditional checks for the same object being in both
arrays. It doesn't check for two different but equivalent objects
being in the two arrays. With strings, you probably want to use
isEqualToString: or one of the compare:... methods, instead of the ==
operator.
Regards,
Ken
_______________________________________________
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