iphone - NSSet intersectsSet implementation -


I need to make a method to compare some NSSet and see whether all objects are or if this object is missing And what is this object, I just made the view on the loaded mode, but I need a method that will check all the NSSet (lots). I did not work so well.

  - (zero) viewDidoadload {[Super Viewedload]; NSMutableSet * masterSet = [[NSMutableSet alloc] initWithObjects: @ "0", @ "1", @ "2", @ "3", @ "4", zero]; NSMutableSet * set2 = [[NSMutableSet alloc] initWithObjects: @ "0", @ "1", @ "2", @ "3", zero]; NSMutableSet * set3 = [[NSMutableSet alloc] initWithObjects: @ "2", @ "10", @ "12", @ "14", @ "18", zero]; If ([Mastering Setting Assetsetset: Set 2] == [Set 2 Count]) {NSLog (@ "Set 2:% @", Set 2); }}   

In this example, I try to check if all the objects on set2 are in the masterset, then I print set2, I do not understand why this does not work Is doing this because it is not printing on logs.

If someone can help me, then I get this method "if" NSset I have, and to check whether an object is not in full match, also get this object . Thanks

intersection set: return BOOL . It means 0 (wrong) or 1 (true). So, unless your count on Set 2 is greater than 1, this statement can not be true.

The method you are looking for is:

Comments