Re: Search Array for Variable in Object
Re: Search Array for Variable in Object
- Subject: Re: Search Array for Variable in Object
- From: Steve Gran <email@hidden>
- Date: Tue, 6 Dec 2005 15:06:12 -0800
I'll give that a try. I had thought that was only for Dictionaries
and since I am only using an array it wasn't applicable. I probably
need to read more about Key Value Coding to understand that better
and how keys and values are used in an array.
I think I also confused the explanation of what I am trying to do a
bit. I'm not really sure which of my objects will contain the
instance variable value I'm looking for. I do know that the out of
the entire array of objects, one (and only one) of those objects will
have the specific instance variable value I need to query.
I guess a more accurate example would be something like this:
myArrayOfCars (which contains objects from say my Car class, each
with a number of instance variables like Make, Model, Year, Color,
LicensePlate#).
Course what I'm trying to do is then look up the LicensePlate#
instance variable (which of course is unique). Then kick out some of
the other instance variable values. So if the LicensePlate# == "123
ABC" (which might happen to be in the Car3 object but I won't know
that during the lookup), then I could have Car3 return whatever other
variable I want (it's Color iVar, it's Model iVar, etc.)
But I'll read more about key value coding and see if I can get this
to work.
>The example given in "Using Predicates with Relationships" shows
>"department.name like %@"; to filter an array you could use something
>like:
> "myObject3 like [cd] 'WhatIWant'"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden