オブジェクトの があり、NSArrayとContact呼ぶことができますcontacts。Contact はスーパークラスでFacebookGroupありIndividual、のサブクラスですContact。オブジェクトのセットであるFacebookGroupというプロパティがあります。individualsIndividual
オブジェクトのもありNSArrayます。NSStringこれを と呼ぶことができますuserIDs。
私がしたいのは、のユーザーIDに一致NSArrayする既存の配列から新しいを作成することです。contactsuserIDs
したがって、ifには1、2、および3 のcontacts3 つのContactオブジェクトがあり、myにはオブジェクト 3 があります。次に、結果の配列に3に等しいものが含まれるようにします。userIDuserIDsNSStringContactuserID
Contact.h
Contact : NSObject
FacebookGroup.h
FacebookGroup : Contact
@property (nonatomic, strong) NSSet *individuals;
個人.h
Individual : Contact
@property (nonatomic, strong) NSString *userID;