NSSet如何转成NSArray

//如果想排序以后再取,可以这样:
NSSet *users = [groupUser users];
NSSortDescriptor *sd = [[NSSortDescriptor alloc] initWithKey:@"displayName" ascending:YES];
NSArray *sortDescriptors = [NSArray arrayWithObjects:sd, nil];
NSArray *userArray = [users sortedArrayUsingDescriptors:sortDescriptors];
//如果直接取,可以这样:
NSArray *userArray = [users  allObjects];

你可能感兴趣的:(NSSet如何转成NSArray)