NSDictionary* dict=[NSDictionary dictionaryWithObjectsAndKeys:@"第一个学生",@"first",@"第二个学生",@"second", nil];
NSArray* keys=[dict allKeys];
id key,value;
for (int i=0; i<[keys count]; i++) {
key=[keys objectAtIndex:i];
value=[dict objectForKey:key];
NSLog(@"key:%@ \n value:%@",key,value);
}
NSSet *set1 = [[NSSet alloc] initWithObjects:@"one",@"two",@"three",@"four",@"five",@"six", nil];
NSArray *array = [NSArray arrayWithObjects:@"1",@"2",@"3",@"4",@"one", nil];
NSSet *set2 = [[NSSet alloc] initWithArray:array];
NSSet *set3 = [[NSSet alloc] initWithSet:set2];
NSInteger count = [set3 count];
NSArray *allObjects = [set3 allObjects];
id object = [set3 anyObject];
BOOL isContain = [set2 containsObject:@"2"];
BOOL isIntersect = [set2 intersectsSet:set1];
BOOL isEqual = [set1 isEqualToSet:set2];
BOOL isSubset = [set2 isSubsetOfSet:set1];
NSLog(@"1=%ld、2=%@、3=%@、4=%d、5=%d、6=%d、7=%d",count,allObjects,object,isContain,isIntersect,isEqual,isSubset);
NSMutableSet *set11 = [NSMutableSet set];
NSMutableSet *set12 = [NSMutableSet setWithObjects:@"1",@"2",nil];
NSMutableSet *set13 = [NSMutableSet setWithObjects:@"a",@"2",nil];
[set12 minusSet:set13];
[set12 intersectSet:set13];
[set12 unionSet:set13];
[set11 setSet:set13];
[set12 addObjectsFromArray:array];
[set12 removeObject:@"1"];
NSLog(@"%@",set12);