i have an array list of custom objects. each object contains a value i need to pull out, claimNO, but is not a unique value, meaning say 5 objects may have the same claimNO.
Couple points, for the objectForKey
, check for nil
to determine the absence of the key.
Also, you could just drop the array of claims into an NSSet
that seems to closer to the desired behavior. But I am unsure, if you want to just access one or all of the claims for any given claim number.
I think design wise what you are doing will work, but generalize your claim class to include all the claims for any given claim number. Keep you dictionary and the claim number key will access all of the given claims attached to a unique claim number.